Browse Source

work on draft

espitau 8 years ago
parent
commit
2784f779db
2 changed files with 140 additions and 0 deletions
  1. 40 0
      main.tex
  2. 100 0
      src/random_search

+ 40 - 0
main.tex

@@ -46,6 +46,46 @@
 
 \subsection{Fully random search (Test case)}
   Blabla+pipeline
+  \subsection{The Knuth-Fisher-Yates shuffle}
+
+The Fisher–Yates shuffle is an algorithm for generating a random permutation 
+of a finite sets. The Fisher–Yates shuffle is unbiased, so that every 
+permutation is equally likely. We present here the Durstenfeld variant of 
+the algorithm, presented by Knuth in \emph{The Art of Computrer programming}.
+The algorithm's time complexity is here $O(n)$, compared to $O(n^2)$ of 
+the naive implementation.
+
+\begin{algorithm}[H]
+  \SetAlgoLined
+  \SetKwFunction{Rand}{Rand}
+  \SetKwFunction{Swap}{Swap}
+  \KwData{A table T[1..n]}
+  \KwResult{Same table T, shuffled}
+  \For{$i\leftarrow 1$ \KwTo $n-1$}{
+     $j \leftarrow$ \Rand{$[1,n-i]$}\;
+     \Swap{$T[i], T[i+j]$}\;
+    }
+  \caption{KFY algorithm}
+\end{algorithm}
+
+
+\begin{lemma}
+  The resulting permutation of KFY is unbiaised.
+\end{lemma}
+\begin{proof}
+  Let consider the set $[1,\ldots n]$ as the vertices of a random graph 
+  constructed as the trace of the execution of the algorithm: 
+  an edge $(i,j)$ exists in the graph if and only if the swap of $T[i]$ and
+  $T[j]$ had been executed. This graph encodes the permutation represented by
+  $T$. To be able to encode any permutation the considered graph must be connex 
+  --- in order to allow any pairs of points to be swapped ---.
+  Since by construction every points is reached by an edge, and that there 
+  exists exactly $n-1$ edges, we can conclude directly that any permutation can
+  be reached by the algorithm. Since the probability of getting a fixed graph 
+  of $n-1$ edges with every edges of degree at least one is $n!^{-1}$, the 
+  algorithm is thus unbiaised.
+
+\end{proof}
 \subsection{Local Search}
   Blabla+Pipeline
 \subsection{Evolutionary heuristics}

+ 100 - 0
src/random_search

@@ -0,0 +1,100 @@
+0.571429	0.538462
+0.142857	0.230769
+0.000000	0.923077
+0.428571	0.384615
+0.857143	0.307692
+0.285714	0.769231
+0.795918	0.846154
+0.653061	0.076923
+0.224490	0.615385
+0.081633	0.153846
+0.510204	0.692308
+0.938776	0.000000
+0.367347	0.502959
+0.734694	0.579882
+0.591837	0.272189
+0.163265	0.964497
+0.020408	0.426036
+0.448980	0.349112
+0.877551	0.810651
+0.306122	0.887574
+0.714286	0.118343
+0.571429	0.656805
+0.142857	0.195266
+0.000000	0.733728
+0.428571	0.041420
+0.857143	0.479290
+0.285714	0.556213
+0.775510	0.248521
+0.632653	0.940828
+0.204082	0.402367
+0.061224	0.325444
+0.489796	0.786982
+0.918367	0.863905
+0.346939	0.094675
+0.836735	0.633136
+0.693878	0.171598
+0.265306	0.710059
+0.122449	0.017751
+0.551020	0.532544
+0.979592	0.609467
+0.408163	0.301775
+0.755102	0.994083
+0.612245	0.455621
+0.183673	0.378698
+0.040816	0.840237
+0.469388	0.917160
+0.897959	0.147929
+0.326531	0.686391
+0.827988	0.224852
+0.685131	0.763314
+0.256560	0.071006
+0.113703	0.491124
+0.542274	0.568047
+0.970845	0.260355
+0.399417	0.952663
+0.807580	0.414201
+0.664723	0.337278
+0.236152	0.798817
+0.093294	0.875740
+0.521866	0.106509
+0.950437	0.644970
+0.379009	0.183432
+0.746356	0.721893
+0.603499	0.029586
+0.174927	0.485207
+0.032070	0.562130
+0.460641	0.254438
+0.889213	0.946746
+0.317784	0.408284
+0.725948	0.331361
+0.583090	0.792899
+0.154519	0.869822
+0.011662	0.100592
+0.440233	0.639053
+0.868805	0.177515
+0.297376	0.715976
+0.787172	0.023669
+0.644315	0.520710
+0.215743	0.597633
+0.072886	0.289941
+0.501458	0.982249
+0.930029	0.443787
+0.358601	0.366864
+0.848397	0.828402
+0.705539	0.905325
+0.276968	0.136095
+0.134111	0.674556
+0.562682	0.213018
+0.991254	0.751479
+0.419825	0.059172
+0.766764	0.526627
+0.623907	0.603550
+0.195335	0.295858
+0.052478	0.988166
+0.481050	0.449704
+0.909621	0.372781
+0.338192	0.834320
+0.819242	0.911243
+0.676385	0.142012
+0.247813	0.680473