main.tex 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314
  1. % ------------------------------------------------------------------------
  2. \documentclass{llncs}
  3. \input{prelude}
  4. \begin{document}
  5. \title{Star Discrepancies for generalized Halton points}
  6. % \titlerunning{} % abbreviated title (for running head)
  7. % also used for the TOC unless
  8. % \toctitle is used
  9. \author{Thomas Espitau\inst{1} \and Olivier Marty\inst{1}}
  10. %
  11. % \authorrunning{} % abbreviated author list (for running head)
  12. %
  13. %%%% list of authors for the TOC (use if author list has to be modified)
  14. % \tocauthor{}
  15. %
  16. \institute{
  17. $\mbox{}^1$ ENS Cachan \qquad
  18. }
  19. \maketitle
  20. \makeatletter
  21. \makeatother
  22. \begin{abstract}
  23. \end{abstract}
  24. \section{Introduction}
  25. \section{General architecture of the tool}
  26. The testing tool is aimed to be modular: it is made of independents blocks that
  27. are interfaced trough a scheduler. More precisely a master wrapper is written
  28. in Python that calls a first layer which performs the chosen heuristic. This
  29. layer is written in C++ for performances. The given discrepancy algorithm
  30. --- written in C --- is called when evaluations of a state is needed.
  31. The wrapper dispatch the computations on the multi-core architecture of
  32. modern computers\footnote{for us, between 2 and 4 physical cores and 4 or 8
  33. virtual cores}. This basic architecture is described in figure~\ref{main_flow}.
  34. Experiments were conducted on two machines:
  35. \begin{itemize}
  36. \item 2.4 GHz Intel Dual Core i5 hyper-threaded to 2.8GHz, 8 Go 1600 MHz DDR3.
  37. \item 2.8 GHz Intel Quad Core i7 hyper-threaded to 3.1GHz, 8 Go 1600 MHz DDR3.
  38. \end{itemize}
  39. \begin{figure}
  40. \includegraphics[scale=0.6]{main_flow.pdf}
  41. \caption{Tool overview}
  42. \label{main_flow}
  43. \end{figure}
  44. On these machines, some basic profiling has make clear that
  45. the main bottleneck of the computations is hiding in the \emph{computation
  46. of the discrepancy}. The chosen algorithm and implantation of this
  47. cost function is the DEM-algorithm~\cite{Dobkin} of
  48. \emph{Magnus Wahlstr\o m}~\cite{Magnus}.\medskip
  49. All the experiments has been conducted on dimension 2,3,4
  50. --- with a fixed Halton basis 7, 13, 29, 3 ---. Some minor tests have
  51. been made in order to discuss the dependency of the discrepancy and
  52. efficiency of the heuristics with regards to the values chosen for the
  53. prime base. The average results remains roughly identical when taking
  54. changing these primes and taking them in the range [2, 100]. For such
  55. a reason we decided to pursue the full computations with a fixed
  56. basis.
  57. \subsection{Algorithmic insights}
  58. To perform an experiment we made up a
  59. loop above the main algorithm which calls the chosen heuristic multiple
  60. times in order to smooth up the results and obtain more exploitable datas.
  61. Then an arithmetic mean of the result is performed on the values. In addition
  62. extremal values are also given in order to construct error bands graphs.
  63. A flowchart of the conduct of one experiment is described in the
  64. flowchart~\ref{insight_flow}. The number of iteration of the heuristic is
  65. I and the number of full restart is N. Th function Heuristic() correspond to
  66. a single step of the chosen heuristic. We now present an in-depth view of
  67. the implemented heuristics.
  68. \begin{figure}
  69. \begin{mdframed}
  70. \includegraphics[scale=0.4]{insight.pdf}
  71. \caption{Flowchart of a single experiment}
  72. \label{insight_flow}
  73. \end{mdframed}
  74. \end{figure}
  75. Graph are presented not with the usual "mustache boxes" to show the
  76. error bounds, but in a more graphical way with error bands. The graph
  77. of the mean result is included inside a band of the same color which
  78. represents the incertitude with regards to the values obtained.
  79. \section{Heuristics developed}
  80. \subsection{Fully random search (Test case)}
  81. The first heuristic implemented is the random search. We generates
  82. random sets of Halton points and select the best set with regard to its
  83. discrepancy iteratively. The process is wrapped up in the
  84. flowchart~\ref{random_flow}. In order to generate at each step a random
  85. permutation, we transform it directly from the previous one.
  86. More precisely the permutation is a singleton object which have method
  87. random, built on the Knuth Fisher Yates shuffle. This algorithm allows
  88. us to generate an uniformly chosen permutation at each step. We recall
  89. this fact and detail the algorithm in the following section.
  90. \begin{figure}
  91. \begin{mdframed}
  92. \includegraphics[scale=0.4]{flow_rand.pdf}
  93. \caption{Flowchart of the random search}
  94. \label{random_flow}
  95. \end{mdframed}
  96. \end{figure}
  97. \subsubsection{The Knuth-Fisher-Yates shuffle}
  98. The Fisher–Yates shuffle is an algorithm for generating a random permutation
  99. of a finite sets. The Fisher–Yates shuffle is unbiased, so that every
  100. permutation is equally likely. We present here the Durstenfeld variant of
  101. the algorithm, presented by Knuth in \emph{The Art of Computer programming}
  102. vol. 2~\cite{Knuth}.
  103. The algorithm's time complexity is here $O(n)$, compared to $O(n^2)$ of
  104. the naive implementation.
  105. \begin{algorithm}[H]
  106. \SetAlgoLined
  107. \SetKwFunction{Rand}{Rand}
  108. \SetKwFunction{Swap}{Swap}
  109. \KwData{A table T[1..n]}
  110. \KwResult{Same table T, shuffled}
  111. \For{$i\leftarrow 1$ \KwTo $n-1$}{
  112. $j \leftarrow$ \Rand{$[1,n-i]$}\;
  113. \Swap{$T[i], T[i+j]$}\;
  114. }
  115. \caption{KFY algorithm}
  116. \end{algorithm}
  117. \begin{lemma}
  118. The resulting permutation of KFY is unbiased.
  119. \end{lemma}
  120. \begin{proof}
  121. Let consider the set $[1,\ldots n]$ as the vertices of a random graph
  122. constructed as the trace of the execution of the algorithm:
  123. an edge $(i,j)$ exists in the graph if and only if the swap of $T[i]$ and
  124. $T[j]$ had been executed. This graph encodes the permutation represented by
  125. $T$. To be able to encode any permutation the considered graph must be
  126. connected --- in order to allow any pairs of points to be swapped ---.
  127. Since by construction every points is reached by an edge, and that there
  128. exists exactly $n-1$ edges, we can conclude directly that any permutation can
  129. be reached by the algorithm. Since the probability of getting a fixed graph
  130. of $n-1$ edges with every edges of degree at least one is $n!^{-1}$, the
  131. algorithm is thus unbiased.
  132. \end{proof}
  133. \subsubsection{Results and stability}
  134. We first want to analyze the dependence of the results on the number of
  135. iterations of the heuristic, in order to discuss its stability.
  136. The results are compiled in the figures~\ref{rand_iter2},~\ref{rand_iter3},
  137. restricted to a number of points between 80 and 180.
  138. We emphasize on the fact the lots of datas appears on the graphs,
  139. and the error bands representation make them a bit messy. These graphs
  140. were made for extensive internal experiments and parameters researches.
  141. The final wrap up graphs are much more lighter and only presents the best
  142. results obtained.
  143. As expected from a fully random search, the error bands are very large for
  144. low number of iterations ($15\%$ of the value for 400 iterations) and tends
  145. to shrink with a bigger number of iterations (around $5\%$ for 1600 iterations).
  146. This shrinkage is a direct consequence of well known concentrations bounds
  147. (Chernoff and Asuma-Hoeffding).
  148. The average results are quite stable, they decrease progressively with
  149. the growing number of iterations, but seems to get to a limits after 1000
  150. iterations. This value acts as a threshold for the interesting number of iterations.
  151. As such interesting results can be conducted with \emph{only} 1000 iterations,
  152. without altering too much the quality of the set with regards to its
  153. discrepancy and this heuristic.
  154. \begin{figure}
  155. \includegraphics[scale=0.3]{Results/random_iter.png}
  156. \caption{Dependence on iterations, dimension 2}
  157. \label{rand_iter2}
  158. \end{figure}
  159. \begin{figure}
  160. \includegraphics[scale=0.3]{Results/random_iter_3.png}
  161. \caption{Dependence on iterations, dimension 3}
  162. \label{rand_iter3}
  163. \end{figure}
  164. \subsection{Evolutionary heuristic: Simulated annealing and local search}
  165. The second heuristic implemented is a randomized local search with
  166. simulated annealing. This heuristic is inspired by the physical
  167. process of annealing in metallurgy.
  168. Simulated annealing interprets the physical slow cooling as a
  169. slow decrease in the probability of accepting worse solutions as it
  170. explores the solution space.
  171. More precisely the neighbours are here the permutations which can be obtained
  172. by application of exactly one transposition of the current permutation.
  173. The selection phase is dependant on the current temperature:
  174. after applying a random transposition on the current permutation, either
  175. the discrepancy of the corresponding Halton set is decreased and the
  176. evolution is kept, either it does not but is still kept with
  177. a probability $e^{\frac{\delta}{T}}$ where $\delta$ is the difference
  178. between the old and new discrepancy, and $T$ the current temperature.
  179. The all algorithm is described in the flowchart~\ref{flow_rec}.
  180. \begin{figure}
  181. \begin{mdframed}
  182. \includegraphics[scale=0.4]{flow_recuit.pdf}
  183. \caption{Flowchart of the simulated annealing local search heuristic}
  184. \label{flow_rec}
  185. \end{mdframed}
  186. \end{figure}
  187. \subsubsection{Dependence on the temperature}
  188. First experiments were made to select the best initial temperature.
  189. Results are compiled in graphs~\ref{temp_2},~\ref{temp3},\ref{temp3_z}.
  190. Graphs~\ref{temp_2},~\ref{temp3} represents the results obtained respectively
  191. in dimension 2 and 3 between 10 and 500 points. The curve obtained is
  192. characteristic of the average evolution of the discrepancy optimization
  193. algorithms for Halton points sets: a very fast decrease for low number of
  194. points --- roughly up to 80 points --- and then a very slow one
  195. after~\cite{Doerr}.
  196. The most interesting part of these results are concentrated between 80 and 160
  197. points were the different curves splits. The graph~\ref{temp3_z} is a zoom
  198. of~\ref{temp3} in this window. We remark on that graph that the lower the
  199. temperature is, the best the results are.
  200. \begin{figure}
  201. \includegraphics[scale=0.3]{Results/resu_2_temp.png}
  202. \caption{Dependence on initial temperature: D=2}
  203. \label{temp_2}
  204. \end{figure}
  205. \begin{figure}
  206. \includegraphics[scale=0.3]{Results/resu_temp3.png}
  207. \caption{Dependence on initial temperature: D=3}
  208. \label{temp3}
  209. \end{figure}
  210. \begin{figure}
  211. \includegraphics[scale=0.3]{Results/resu_temp3_zoom.png}
  212. \caption{Dependence on initial temperature (zoom): D=3}
  213. \label{temp3_z}
  214. \end{figure}
  215. \subsubsection{Stability with regards to the number of iterations}
  216. As for the fully random search heuristic we investigated the stability
  217. of the algorithm with regards to the number of iterations. We present here
  218. the result in dimension 3 in the graph~\ref{iter_sa}. Once again we
  219. restricted the window between 80 and 180 points were curves are split.
  220. An interesting phenomena can be observed: the error rates are somehow
  221. invariant w.r.t.\ the number of iteration and once again the 1000 iterations
  222. threshold seems to appear --- point 145 is a light split between iteration
  223. 1600 and the others, but excepted for that point, getting more than 1000
  224. iterations tends be be a waste of time. The error rate is for 80 points the
  225. biggest and is about $15\%$ of the value, which is similar to the error
  226. rates for fully random search with 400 iterations.
  227. \begin{figure}
  228. \includegraphics[scale=0.3]{Results/sa_iter.png}
  229. \caption{Dependence on iterations number for simulated annealing : D=3}
  230. \label{iter_sa}
  231. \end{figure}
  232. \subsection{Genetic (5+5) search}
  233. \begin{figure}
  234. \begin{mdframed}
  235. \label{rand_flow}
  236. \includegraphics[scale=0.4]{crossover_flow.pdf}
  237. \caption{Flowchart of the crossover algorithm.}
  238. \end{mdframed}
  239. \end{figure}
  240. \begin{figure}
  241. \label{rand_flow}
  242. \includegraphics[scale=0.3]{Results/res_gen_2.png}
  243. \caption{Dependence on iterations number: D=3}
  244. \end{figure}
  245. \begin{figure}
  246. \label{rand_flow}
  247. \includegraphics[scale=0.3]{Results/res_gen_2_zoom.png}
  248. \caption{Dependence on iterations number: D=3}
  249. \end{figure}
  250. \begin{figure}
  251. \label{rand_flow}
  252. \includegraphics[scale=0.3]{Results/res_gen_3_zoom.png}
  253. \caption{Dependence on iterations number: D=3}
  254. \end{figure}
  255. \begin{figure}
  256. \label{rand_flow}
  257. \includegraphics[scale=0.3]{Results/res_gen_4_zoom.png}
  258. \caption{Dependence on iterations number: D=3}
  259. \end{figure}
  260. \section{Results}
  261. \section{Conclusion}
  262. \bibliographystyle{alpha}
  263. \bibliography{bi}
  264. \end{document}