diff --git a/graph.py b/graph.py index 6cfb9aed50d398be0558d1346ab27baf111800b0..a552513f8d81ccb32d5caa7acf160704875a5c89 100644 --- a/graph.py +++ b/graph.py @@ -247,4 +247,3 @@ class Graph: pygame.display.flip() clock.tick(1000) - diff --git a/images/.DS_Store b/images/.DS_Store index 5008ddfcf53c02e82d7eee2e57c38e5672ef89f6..b122f7c8e546b4a081a89b73aa571bf273c6e783 100644 Binary files a/images/.DS_Store and b/images/.DS_Store differ diff --git a/images/0CVX_rd100_simple_1.png b/images/0CVX_rd100_simple_1.png new file mode 100644 index 0000000000000000000000000000000000000000..633d90f02d4e8dc266ff405e1f706e8c125d49c7 Binary files /dev/null and b/images/0CVX_rd100_simple_1.png differ diff --git a/images/0CVX_rd100_simple_11.png b/images/0CVX_rd100_simple_11.png new file mode 100644 index 0000000000000000000000000000000000000000..bb16578fd4a211046d81ef856e487af912f9e5a3 Binary files /dev/null and b/images/0CVX_rd100_simple_11.png differ diff --git a/images/0CVX_rd100_simple_21.png b/images/0CVX_rd100_simple_21.png new file mode 100644 index 0000000000000000000000000000000000000000..00875d8e1ada7e39826802f0916b644ec2a01126 Binary files /dev/null and b/images/0CVX_rd100_simple_21.png differ diff --git a/images/0CVX_rd100_simple_31.png b/images/0CVX_rd100_simple_31.png new file mode 100644 index 0000000000000000000000000000000000000000..0e9072b404cadd10088de343af71f67db10afacd Binary files /dev/null and b/images/0CVX_rd100_simple_31.png differ diff --git a/images/0CVX_rd100_simple_41.png b/images/0CVX_rd100_simple_41.png new file mode 100644 index 0000000000000000000000000000000000000000..0e9072b404cadd10088de343af71f67db10afacd Binary files /dev/null and b/images/0CVX_rd100_simple_41.png differ diff --git a/new_separation.py b/new_separation.py index f12e7b09775d5bbb828ef2f7824b92e862e35f77..60a12f69723965d300d9deddc0ecefec855f1adf 100644 --- a/new_separation.py +++ b/new_separation.py @@ -270,11 +270,11 @@ def algorithme_separation(graphe, filename="default_separation_output",epsilon = oldvalue = value chemin = convert_to_edges (graphe, sol) - if(iteration == 1): + if(iteration % 10 == 1): if(isinstance(graphe.cities[0],city.Euc_2D)): graphe.draw(chem = [u for (u,c) in chemin ], poids = [c for (u,c) in chemin ], - filename="images/0CVX_{}_simple.png".format (filename)) + filename="images/0CVX_{}_simple_{}.png".format (filename,iteration)) sol = np.round(sol,3) @@ -372,4 +372,4 @@ def test_separation_on_file (filename): -test_separation_on_file("u574") +test_separation_on_file("rd100") diff --git a/parser.py b/parser.py index c00d213d79e749843fc7b4b3c6225d8b18ecf04e..9398c467f3946aeab3bb2d2b072c30e108694ae8 100644 --- a/parser.py +++ b/parser.py @@ -348,12 +348,16 @@ if __name__ == '__main__': level=logging.DEBUG, format='%(asctime)s [%(levelname)s] %(message)s', datefmt='%m/%d/%Y %I:%M:%S %p') - x = read_tsp_file ('problemes/bayg29.tsp') - # print (x["GRAPH"].weights) - M = x["GRAPH"].weights + chemin = [ 1, 200, 198, 197, 195, 194, 218, 193, 196, 192, 191, 205, 189, 27, 188, 187, 186, 185, 184, 182, 181, 180, 179, 178, 177, 176, 174, 173, 172, 171, 170, 169, 168, 212, 214, 167, 166, 165, 164, 213, 158, 163, 162, 161, 160, 159, 157, 156, 155, 154, 153, 152, 151, 150, 149, 148, 147, 146, 145, 144, 143, 201, 142, 141, 140, 139, 138, 137, 136, 183, 135, 134, 215, 132, 131, 211, 130, 222, 129, 128, 127, 126, 125, 124, 123, 122, 121, 175, 120, 119, 118, 117, 116, 223, 115, 114, 113, 112, 111, 110, 109, 108, 107, 106, 105, 220, 104, 103, 102, 101, 100, 99, 98, 97, 96, 95, 209, 94, 93, 92, 91, 90, 89, 88, 87, 210, 86, 85, 84, 83, 82, 221, 81, 80, 79, 78, 77, 217, 219, 216, 76, 75, 74, 73, 72, 71, 70, 69, 68, 67, 66, 65, 64, 63, 62, 61, 60, 59, 58, 57, 56, 55, 54, 53, 52, 50, 51, 49, 207, 2, 47, 225, 190, 133, 199, 224, 48, 45, 46, 44, 43, 42, 41, 40, 39, 38, 37, 36, 34, 33, 35, 32, 31, 206, 202, 30, 29, 28, 204, 26, 25, 208, 24, 23, 22, 21, 20, 203, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 1] + + filename = 'ts225' + + probleme = read_tsp_file ("problemes/{}.tsp".format(filename)) + graphe = probleme["GRAPH"] + + chemin = graphe.sommets_vers_aretes ([ x - 1 for x in chemin ]) + + graphe.draw (chem=chemin) + - for ligne in M: - for elem in ligne: - print ("{:03d}".format (elem), end= " ") - print ("") diff --git a/rapport/presentation.tex b/rapport/presentation.tex index c0d9cca3ba0756847c86cc5db684ca4f2997c7e5..e65befc61827ddb325b5a83504fd4bb71c09eaf0 100644 --- a/rapport/presentation.tex +++ b/rapport/presentation.tex @@ -316,7 +316,7 @@ \begin{block}{Équivalence des contraintes} \begin{center} - Contrainte violée $\iff$ MinCut < 2 + Contrainte violée $\iff$ MinCut $< 2$ \end{center} \end{block} @@ -341,7 +341,7 @@ \subfloat[Après séparation (7899)]{ \includegraphics[width=4cm]{../images/0CVX_rd100_separationfinie.png} } - \caption{Programme linéaire sur ts225 (7910)} + \caption{Programme linéaire sur rd100 (7910)} \end{figure} \end{exampleblock} \end{frame} @@ -430,8 +430,11 @@ \end{figure} \end{exampleblock} - NOTE pour la comparaison: - Glouton = 60110 / Glouton+2OPT = 50826 / Approx2 = 66343 / Approx2 + 2OPT = 54428 + Note pour la comparaison: + Glouton = 60110 + Glouton + 2OPT = 50826 + Approx2 = 66343 + Approx2 + 2OPT = 54428 \end{frame} diff --git a/rapport/rapport_projet_opti.tex b/rapport/rapport_projet_opti.tex index db743cb12e952fb72f8d3424ad668630e836e44e..6165d44c0234ae5f173000aee0232182a8df38f5 100644 --- a/rapport/rapport_projet_opti.tex +++ b/rapport/rapport_projet_opti.tex @@ -904,6 +904,8 @@ ulysses16 & \textcolor{red}{$6859$}& $\textcolor{red}{6859}$& \textcolor{red}{$6 ulysses22 &\textcolor{red}{$7013$} &$\textcolor{red}{7013}$& \textcolor{red}{$7013$} & 8\\ \hline +u574 & 36714 & 36905 & 38572 & 125 \\ \hline + \end{tabular} \end{center} \caption{\label{tabenc} Encadrements obtenus a partir de la Question 5}