def path_length(): """ average path length """ dist = floyd_warshall.run(gi.nodes(),gi.edges()) ret = floyd_warshall.avg(dist) return ret
def total_weight(): ret = 0.0 for e in gi.edges(): ret += gi.get_weight(e) return ret