Commit f9a5b148 authored by Gaetan D's avatar Gaetan D

hop

parents 69f1a6d5 817a39a8
......@@ -247,4 +247,3 @@ class Graph:
pygame.display.flip()
clock.tick(1000)
No preview for this file type
......@@ -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("brazil58")
from collections import deque
from city import GeoCoord, GeoCity, Euc_2D
from city import GeoCoord, GeoCity, Euc_2D, Explicit_2D
from graph import Graph
import logging
......@@ -330,7 +330,7 @@ def read_tsp_file(path):
g = Graph (tsp["NODES"], None)
elif tsp["DISPLAY"] == []:
# raise ValueError ("Matrice ... impossible à parser")
g = Graph ([ Euc_2D (number=i) for i in range (len (tsp["MATRIX"])) ], tsp["MATRIX"])
g = Graph ([Explicit_2D (number=i) for i in range (len (tsp["MATRIX"])) ], tsp["MATRIX"])
else:
# raise ValueError ("Matrice ... impossible à parser")
g = Graph (tsp["DISPLAY"], tsp["MATRIX"])
......@@ -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 ("")
......@@ -111,9 +111,6 @@
\end{itemize}
\end{exampleblock}
\end{frame}
......@@ -350,17 +347,34 @@
\begin{exampleblock}{Exemple~:}
\begin{figure}
\centering
\subfloat[Sans contraintes (7337)]{
\includegraphics[width=4cm]{../images/0CVX_rd100_simple.png}
\subfloat[Itération 1 (7337)]{
\includegraphics[width=2cm]{../images/0CVX_rd100_simple_1.png}
}
\subfloat[Itération 11 (7578)]{
\includegraphics[width=2cm]{../images/0CVX_rd100_simple_11.png}
}
\subfloat[Itération 21 (7867)]{
\includegraphics[width=2cm]{../images/0CVX_rd100_simple_21.png}
}
\subfloat[Après séparation (7899)]{
\includegraphics[width=4cm]{../images/0CVX_rd100_separationfinie.png}
\subfloat[Itération 46 et fin (7899)]{
\includegraphics[width=2cm]{../images/0CVX_rd100_separationfinie.png}
}
\caption{Programme linéaire sur rd100 (7910)}
\end{figure}
\end{exampleblock}
\end{frame}
\subsection{Ajout de contraintes pour l'intégralité}
\begin{frame}
\frametitle{Contraintes supplémentaires}
\begin{block}{coucou}
Copier ici ce qu'on lira de la présentation de Nathanaël
\end{block}
\end{frame}
\begin{frame}
\frametitle{Un encadrement de la solution}
\begin{block}{Borne inférieure}
......@@ -373,6 +387,7 @@
\ds
Combiné avec 2-OPT, donne de bons résultats.
\end{frame}
\section{Outils associés}
\begin{frame}
......@@ -491,6 +506,12 @@
\end{figure}
\end{exampleblock}
\end{frame}
\begin{frame}
plus de résultats
\end{frame}
\section{Dualité}
......
......@@ -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}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment