From 67373cdea01020086fe296d308e4c2a0889b1f9b Mon Sep 17 00:00:00 2001 From: Yann Salmon Date: Sun, 18 Mar 2018 16:54:44 +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 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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"