def flow_hierarchy(G, weight=None):
    if not G.is_directed():
        raise nx.NetworkXError("G must be a digraph in flow_heirarchy")
    scc = nx.strongly_connected_components(G)
    return 1.-sum(G.subgraph(c).size(weight) for c in scc)/float(G.size(weight))
Returns the flow hierarchy of a directed network.
dataset/ETHPy150Open gkno/gkno_launcher/src/networkx/algorithms/hierarchy.py/flow_hierarchy