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()