Compare commits

...

4 commit

作者 SHA1 備註 提交日期
Paul ALNET
06b9500efc tex: NFBP impl detail 2023-06-04 11:18:36 +02:00
Paul ALNET
bfbad23aed tex: NFBP math impl 2023-06-04 11:12:28 +02:00
Paul ALNET
ac6c443beb tex: detail stat analysis complexity 2023-06-04 11:02:26 +02:00
Paul ALNET
064eeabad5 tex: list variables 2023-06-04 10:42:04 +02:00

查看文件

@ -114,7 +114,42 @@ we store each item in the next bin if it fits, otherwise we open a new bin.
will be of random sizes between $ 0 $ and $ 1 $. We will run X simulations % TODO
with 10 packets.
\subsubsection{Variables used in models}
\subsection{Variables used in models}
We use the following variables in our algorithms and models :
\begin{itemize}
\item $ U_n $ : the size of the $ n $-th item. $ (U_n)_{n \in \mathbb{N}} $
denotes the mathematical sequence of random variables of uniform
distribution on $ [0, 1] $ representing the items' sizes.
\item $ T_i $ : the number of items in the $ i $-th bin.
\item $ V_i $ : the size of the first item in the $ i $-th bin.
\item $ H_n $ : the number of bins required to store $ n $ items.
\end{itemize}
Mathematically, the NFBP algorithm imposes the following constraint on the first box :
\begin{align*}
T_1 = k \iff & U_1 + U_2 + \ldots + U_{k-1} < 1 \\
\text{ and } & U_1 + U_2 + \ldots + U_{k} \geq 1 \qquad \text{ with } k \geq 2
\end{align*}
\subsection{Implementation and results}
We implemented the NFBP algorithm in Python \footnotemark, for its ease of use
and broad recommendation. We used the \texttt{random} library to generate
random numbers between $ 0 $ and $ 1 $ and \texttt{matplotlib} to plot the
results.
\footnotetext{The code is available in Annex \ref{annex:probabilistic}}
@ -123,6 +158,8 @@ with 10 packets.
\section{Next Fit Dual Bin Packing algorithm}
The variables used are the same as for NFBP.
\subsection{La giga demo}
Let $ k \in \mathbb{N} $. Let $ (U_n)_{n \in \mathbb{N}} $ be a sequence of
@ -225,8 +262,10 @@ $ f_{U_{k-1}}(y) = 1 $.
\section{Complexity and implementation optimization}
The NFBP algorithm has a linear complexity $ O(n) $, as we only need to iterate
over the items once.
Both the NFBP and NFDBP algorithms have a linear complexity $ O(n) $, as we
only need to iterate over the items once. While the algorithms themselves are
linear, calculating the statistics may not not be. In this section, we will
discuss how to optimize the implementation of the statistical analysis.
\subsection{Performance optimization}