def current_flow_closeness_centrality(G, normalized=True, weight='weight', 
                                      dtype=float, solver='lu'):
    from networkx.utils import reverse_cuthill_mckee_ordering 
    try:
        import numpy as np
    except ImportError:
        raise ImportError('current_flow_closeness_centrality requires NumPy ',
                          'http://scipy.org/')
    try:
        import scipy 
    except ImportError:
        raise ImportError('current_flow_closeness_centrality requires SciPy ',
                          'http://scipy.org/')
    if G.is_directed():
        raise nx.NetworkXError('current_flow_closeness_centrality ',
                               'not defined for digraphs.')
    if G.is_directed():
        raise nx.NetworkXError(\
            "current_flow_closeness_centrality() not defined for digraphs.")
    if not nx.is_connected(G):
        raise nx.NetworkXError("Graph not connected.")
    solvername={"full" :FullInverseLaplacian,
                "lu": SuperLUInverseLaplacian,
                "cg": CGInverseLaplacian}
    n = G.number_of_nodes()
    ordering = list(reverse_cuthill_mckee_ordering(G))
    # make a copy with integer labels according to rcm ordering
    # this could be done without a copy if we really wanted to
    H = nx.relabel_nodes(G,dict(zip(ordering,range(n))))
    betweenness = dict.fromkeys(H,0.0) # b[v]=0 for v in H
    n = G.number_of_nodes()
    L = laplacian_sparse_matrix(H, nodelist=range(n), weight=weight, 
                                dtype=dtype, format='csc')
    C2 = solvername[solver](L, width=1, dtype=dtype) # initialize solver
    for v in H:
        col=C2.get_row(v)
        for w in H:
            betweenness[v]+=col[v]-2*col[w]
            betweenness[w]+=col[v]

    if normalized:
        nb=len(betweenness)-1.0
    else:
        nb=1.0
    for v in H:
        betweenness[v]=nb/(betweenness[v])
    return dict((ordering[k],float(v)) for k,v in betweenness.items())
Compute current-flow closeness centrality for nodes.
dataset/ETHPy150Open gkno/gkno_launcher/src/networkx/algorithms/centrality/current_flow_closeness.py/current_flow_closeness_centrality