tex: add NFBP graphs
This commit is contained in:
parent
1b48dacbed
commit
2dc8ab1b36
3 changed files with 37 additions and 15 deletions
|
@ -184,7 +184,7 @@ results in the form of histograms.
|
|||
|
||||
\footnotetext{The code is available in Annex \ref{annex:probabilistic}}
|
||||
|
||||
We will try to approximate $ \mathbb{E}[X] $ and $ \mathbb{E}[V] $ with $
|
||||
We will try to approximate $ \mathbb{E}[R] $ and $ \mathbb{E}[V] $ with $
|
||||
\overline{X_N} $ using $ {S_n}^2 $. This operation will be done for both $ R =
|
||||
2 $ and $ R = 10^6 $ simulations.
|
||||
|
||||
|
@ -206,25 +206,46 @@ variance and further determine the Confidence Interval (95 \% certainty).
|
|||
\paragraph{2 simulations} We first ran $ R = 2 $ simulations to observe the
|
||||
behavior of the algorithm and the low precision of the results.
|
||||
|
||||
% TODO graph T_i 2 sim
|
||||
\begin{figure}[h]
|
||||
\centering
|
||||
\includegraphics[width=0.8\textwidth]{graphics/graphic-NFBP-Ti-2-sim}
|
||||
\caption{Histogram of $ T_i $ for $ R = 2 $ simulations and $ N = 50 $ items (number of items per bin)}
|
||||
\label{fig:graphic-NFBP-Ti-2-sim}
|
||||
\end{figure}
|
||||
|
||||
On this graph, we can see each value of $ T_i $. Our calculations have yielded
|
||||
that $ \overline{T_1} = 1.0 $ and $ {S_N}^2 = 2.7 $. Our student coefficient is
|
||||
$ t_{0.95, 2} = 4.303 $.
|
||||
On this graph (figure \ref{fig:graphic-NFBP-Ti-2-sim}), we can see each value
|
||||
of $ T_i $. Our calculations have yielded that $ \overline{T_1} = 1.0 $ and $
|
||||
{S_N}^2 = 2.7 $. Our Student coefficient is $ t_{0.95, 2} = 4.303 $.
|
||||
|
||||
We can now calculate the Confidence Interval for $ T_1 $ for $ R = 2 $ simulations :
|
||||
|
||||
\begin{align*}
|
||||
\overline{T_1} = \sum_{k=1}^{2} {T_1}_k & = 1.0 \\
|
||||
IC_{95\%}(T_1) & = \left[ 1.0 \pm 1.96 \frac{\sqrt{2.7}}{\sqrt{2}} \cdot 4.303 \right] \\
|
||||
& = \left[ 1 \pm 9.8 \right] \\
|
||||
IC_{95\%}(T_1) & = \left[ 1.0 \pm 1.96 \frac{\sqrt{2.7}}{\sqrt{2}} \cdot 4.303 \right] \\
|
||||
& = \left[ 1 \pm 9.8 \right] \\
|
||||
\end{align*}
|
||||
|
||||
With two simulations, we obtain $ \overline{T_1} = 1.0 $.
|
||||
We can see that the Confidence Interval is very large, which is due to the low
|
||||
number of simulations. Looking at figure \ref{fig:graphic-NFBP-Ti-2-sim}, we
|
||||
easily notice the high variance.
|
||||
|
||||
\begin{figure}[h]
|
||||
\centering
|
||||
\includegraphics[width=0.8\textwidth]{graphics/graphic-NFBP-Vi-2-sim}
|
||||
\caption{Histogram of $ V_i $ for $ R = 2 $ simulations and $ N = 50 $ items (size of the first item in a bin)}
|
||||
\label{fig:graphic-NFBP-Vi-2-sim}
|
||||
\end{figure}
|
||||
|
||||
On the graph of $ V_i $ (figure \ref{fig:graphic-NFBP-Vi-2-sim}), we can see
|
||||
that the sizes are scattered pseudo-randomly between $ 0 $ and $ 1 $, which is
|
||||
unsuprising given the low number of simulations. The process determinig the statistics
|
||||
is the same as for $ T_i $, yielding $ \overline{V_1} = 0.897 $, $ {S_N}^2 =
|
||||
0.2 $ and $ IC_{95\%}(V_1) = \left[ 0.897 \pm 1.3 \right] $. In this particular run,
|
||||
the two values for $ V_1 $ are high (being bouded between $ 0 $ and $ 1 $).
|
||||
|
||||
|
||||
\paragraph{1 000 000 simulations} In order to ensure better precision, we then
|
||||
ran $ R = 10^6 $ simulations with $ N = 50 $ different items each.
|
||||
|
||||
IC observed
|
||||
|
||||
We then ran $ R = 10^6 $ simulations with $ N = 50 $ different items each.
|
||||
With 10 6 simulations, we obtain Xn barre = cf graphe
|
||||
Calcul Sn carre
|
||||
IC observed
|
||||
|
@ -261,8 +282,6 @@ were needed to store $ n $ items.
|
|||
|
||||
|
||||
|
||||
\cite{hofri:1987}
|
||||
% TODO mettre de l'Histoire
|
||||
|
||||
\section{Next Fit Dual Bin Packing algorithm (NFDBP)}
|
||||
|
||||
|
@ -505,7 +524,10 @@ then calculate the statistics (which iterates multiple times over the array).
|
|||
|
||||
\subsection{Optimal algorithm}
|
||||
|
||||
\cite{bin-packing-approximation:2022}
|
||||
|
||||
\sectionnn{Conclusion}
|
||||
|
||||
|
||||
\nocite{bin-packing-approximation:2022}
|
||||
\nocite{hofri:1987}
|
||||
|
||||
|
|
BIN
latex/graphics/graphic-NFBP-Ti-2-sim.png
Normal file
BIN
latex/graphics/graphic-NFBP-Ti-2-sim.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 12 KiB |
BIN
latex/graphics/graphic-NFBP-Vi-2-sim.png
Normal file
BIN
latex/graphics/graphic-NFBP-Vi-2-sim.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 21 KiB |
Loading…
Reference in a new issue