diff --git a/python/afficher_graphe.py b/python/afficher_graphe.py index f212b63..52ce92f 100644 --- a/python/afficher_graphe.py +++ b/python/afficher_graphe.py @@ -19,7 +19,7 @@ def export(graphe, oriente, fn, marques=None, distances=None, parents=None) : print("graph {", file = f) lien = " -- " print("""rankdir="LR";""", file=f) - for noeud in range(taille(graphe)) : # énumération des noeuds + for noeud in range(len(graphe)) : # énumération des noeuds label = str(noeud) if marques != None and marques[noeud] : label += "*" @@ -30,8 +30,8 @@ def export(graphe, oriente, fn, marques=None, distances=None, parents=None) : else : label += str(distances[noeud]) + ")" 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)) : + for origine in range(0, len(graphe)) : # énumérationd des arcs + for arrivee in range(0, len(graphe)) : 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"