(graph)
return accessibility
Accessibility matrix (transitive closure).

    @type  graph: graph, digraph, hypergraph
    @param graph: Graph.

    @rtype:  dictionary
    @return: Accessibility information for each node.
Accessibility matrix (transitive closure).
Accessibility matrix ( transitive closure ) .
def accessibility(graph):
    """
    Accessibility matrix (transitive closure).

    @type  graph: graph, digraph, hypergraph
    @param graph: Graph.

    @rtype:  dictionary
    @return: Accessibility information for each node.
    """
    recursionlimit = getrecursionlimit()
    setrecursionlimit(max(len(graph.nodes())*2,recursionlimit))
    
    accessibility = {}        # Accessibility matrix

    # For each node i, mark each node j if that exists a path from i to j.
    for each in graph:
        access = {}
        # Perform DFS to explore all reachable nodes
        _dfs(graph, access, 1, each)
        accessibility[each] = list(access.keys())
    
    setrecursionlimit(recursionlimit)
    return accessibility
def accessibility ( graph ) : recursionlimit = getrecursionlimit ( ) setrecursionlimit ( max ( len ( graph . nodes ( ) ) * 2 , recursionlimit ) ) accessibility = { } # Accessibility matrix # For each node i, mark each node j if that exists a path from i to j. for each in graph : access = { } # Perform DFS to explore all reachable nodes _dfs ( graph , access , 1 , each ) accessibility [ each ] = list ( access . keys ( ) ) setrecursionlimit ( recursionlimit ) return accessibility