From 7f47a264ea735c983993c498323737b542d3e691 Mon Sep 17 00:00:00 2001 From: Yann Salmon Date: Sun, 18 Mar 2018 16:53:47 +0100 Subject: [PATCH] =?UTF-8?q?retrait=20des=20fonctions=20d'acc=C3=A8s=20au?= =?UTF-8?q?=20graphe=20pour=20acc=C3=A8s=20direct=20=C3=A0=20l'implem?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- python/afficher_graphe.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python/afficher_graphe.py b/python/afficher_graphe.py index 71733cf..f212b63 100644 --- a/python/afficher_graphe.py +++ b/python/afficher_graphe.py @@ -32,12 +32,12 @@ def export(graphe, oriente, fn, marques=None, distances=None, parents=None) : print(str(noeud) + '[label="' + label + '"];', file = f) for origine in range(0, taille(graphe)) : # énumérationd des arcs for arrivee in range(0, taille(graphe)) : - if (oriente or origine < arrivee) and arc(graphe, origine, arrivee) : + if (oriente or origine < arrivee) and graphe[origine][arrivee] is not None : if parents != None and parents[arrivee] == origine or not oriente and parents[origine] == arrivee : style = ", penwidth=2, color=red" else : style = "" - print(str(origine) + lien + str(arrivee) + '[label="' + str(poids(graphe, origine, arrivee)) + '"' + style + "];", file=f) + print(str(origine) + lien + str(arrivee) + '[label="' + str(graphe[origine][arrivee]) + '"' + style + "];", file=f) print("}", file=f) f.close()