We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b19123f commit a26d63aCopy full SHA for a26d63a
trabalho3.py
@@ -401,7 +401,14 @@ def spanning_tree(): # SPANNING TREE -------------------------------------------
401
t.es["weight"] = aux2
402
t.vs["label"] = t.vs["name"]
403
t.es["label"] = t.es["weight"]
404
+
405
+ # calculando o custo total da arvore gerada
406
+ custo_total = 0
407
+ for tzin in t.es["weight"]:
408
+ custo_total = custo_total + tzin
409
410
print 'A seguir a sua arvore gerada a partir do Spanning Tree algorithm!'
411
+ print 'Que tem custo total = ' + str(custo_total)
412
plot(t, layout = "kk")
413
salvar(t, "spanning_tree.png", "kk")
414
0 commit comments