retrait des fonctions d'accès au graphe pour accès direct à l'implem
Cette révision appartient à :
@@ -19,7 +19,7 @@ def export(graphe, oriente, fn, marques=None, distances=None, parents=None) :
|
|||||||
print("graph {", file = f)
|
print("graph {", file = f)
|
||||||
lien = " -- "
|
lien = " -- "
|
||||||
print("""rankdir="LR";""", file=f)
|
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)
|
label = str(noeud)
|
||||||
if marques != None and marques[noeud] :
|
if marques != None and marques[noeud] :
|
||||||
label += "*"
|
label += "*"
|
||||||
@@ -30,8 +30,8 @@ def export(graphe, oriente, fn, marques=None, distances=None, parents=None) :
|
|||||||
else :
|
else :
|
||||||
label += str(distances[noeud]) + ")"
|
label += str(distances[noeud]) + ")"
|
||||||
print(str(noeud) + '[label="' + label + '"];', file = f)
|
print(str(noeud) + '[label="' + label + '"];', file = f)
|
||||||
for origine in range(0, taille(graphe)) : # énumérationd des arcs
|
for origine in range(0, len(graphe)) : # énumérationd des arcs
|
||||||
for arrivee in range(0, taille(graphe)) :
|
for arrivee in range(0, len(graphe)) :
|
||||||
if (oriente or origine < arrivee) and graphe[origine][arrivee] is not None :
|
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 :
|
if parents != None and parents[arrivee] == origine or not oriente and parents[origine] == arrivee :
|
||||||
style = ", penwidth=2, color=red"
|
style = ", penwidth=2, color=red"
|
||||||
|
|||||||
Référencer dans un nouveau ticket
Bloquer un utilisateur