Module Expr Str Assign NameStore Str ImportFrom alias Import alias identifier ImportFrom alias Assign NameStore ListLoad Str Str FunctionDef arguments args NameParam NameParam defaults body Expr Str If CompareNotIn NameLoad NameLoad body Raise Call AttributeLoad NameLoad attr Str Assign NameStore Dict NameLoad NameLoad Assign NameStore Call NameLoad Call AttributeLoad NameLoad attr NameLoad NameLoad Assign NameStore DictComp NameLoad NameLoad comprehension TupleStore NameStore NameStore Call NameLoad NameLoad Expr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr FunctionDef arguments args NameParam NameParam defaults body While CompareNotEq NameLoad NameLoad body While CompareLt SubscriptLoad NameLoad Index NameLoad SubscriptLoad NameLoad Index NameLoad body Assign NameStore SubscriptLoad NameLoad Index NameLoad While CompareGt SubscriptLoad NameLoad Index NameLoad SubscriptLoad NameLoad Index NameLoad body Assign NameStore SubscriptLoad NameLoad Index NameLoad Return NameLoad decorator_list Assign NameStore NameLoad While NameLoad body Assign NameStore NameLoad For NameStore NameLoad body Assign NameStore Call NameLoad NameLoad GeneratorExp NameLoad comprehension NameStore SubscriptLoad AttributeLoad NameLoad attr Index NameLoad CompareIn NameLoad NameLoad If BoolOpOr CompareNotIn NameLoad NameLoad CompareNotEq SubscriptLoad NameLoad Index NameLoad NameLoad body Assign SubscriptStore NameLoad Index NameLoad NameLoad Assign NameStore NameLoad Return NameLoad decorator_list Call NameLoad Str FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad Assign NameStore DictComp NameLoad Call NameLoad comprehension NameStore NameLoad For NameStore NameLoad body If CompareGtE Call NameLoad SubscriptLoad AttributeLoad NameLoad attr Index NameLoad Num body For NameStore SubscriptLoad AttributeLoad NameLoad attr Index NameLoad body If CompareIn NameLoad NameLoad body While CompareNotEq NameLoad SubscriptLoad NameLoad Index NameLoad body Expr Call AttributeLoad SubscriptLoad NameLoad Index NameLoad attr NameLoad Assign NameStore SubscriptLoad NameLoad Index NameLoad Return NameLoad decorator_list
N/A N/A 
Dominance algorithms.
 N/A __author__ ysitu <ysitu@users.noreply.github.com> functools reduce N/A networkx nx networkx.utils not_implemented_for N/A __all__ N/A immediate_dominators dominance_frontiers immediate_dominators N/A N/A G start N/A N/A N/A Returns the immediate dominators of all nodes of a directed graph.

    Parameters
    ----------
    G : a DiGraph or MultiDiGraph
        The graph where dominance is to be computed.

    start : node
        The start node of dominance computation.

    Returns
    -------
    idom : dict keyed by nodes
        A dict containing the immediate dominators of each node reachable from
        `start`.

    Raises
    ------
    NetworkXNotImplemented
        If `G` is undirected.

    NetworkXError
        If `start` is not in `G`.

    Notes
    -----
    Except for `start`, the immediate dominators are the parents of their
    corresponding nodes in the dominator tree.

    Examples
    --------
    >>> G = nx.DiGraph([(1, 2), (1, 3), (2, 5), (3, 4), (4, 5)])
    >>> sorted(nx.immediate_dominators(G, 1).items())
    [(1, 1), (2, 1), (3, 1), (4, 3), (5, 1)]

    References
    ----------
    .. [1] K. D. Cooper, T. J. Harvey, and K. Kennedy.
           A simple, fast dominance algorithm.
           Software Practice & Experience, 4:110, 2001.
     N/A N/A start G N/A N/A N/A N/A nx NetworkXError start is not in G N/A idom N/A start start N/A order N/A list N/A N/A nx dfs_postorder_nodes G start N/A dfn N/A u i N/A N/A i u N/A enumerate order N/A N/A N/A order pop N/A N/A N/A order reverse intersect N/A N/A u v N/A N/A N/A N/A u v N/A N/A N/A N/A dfn N/A u N/A dfn N/A v N/A N/A u N/A idom N/A u N/A N/A N/A dfn N/A u N/A dfn N/A v N/A N/A v N/A idom N/A v N/A u N/A N/A changed True N/A changed N/A N/A changed False N/A u order N/A N/A new_idom N/A reduce intersect N/A v N/A v N/A N/A G pred N/A u N/A v idom N/A N/A N/A u idom N/A N/A idom N/A u new_idom N/A N/A N/A idom N/A u new_idom N/A changed True N/A idom N/A N/A not_implemented_for undirected dominance_frontiers N/A N/A G start N/A N/A N/A Returns the dominance frontiers of all nodes of a directed graph.

    Parameters
    ----------
    G : a DiGraph or MultiDiGraph
        The graph where dominance is to be computed.

    start : node
        The start node of dominance computation.

    Returns
    -------
    df : dict keyed by nodes
        A dict containing the dominance frontiers of each node reachable from
        `start` as lists.

    Raises
    ------
    NetworkXNotImplemented
        If `G` is undirected.

    NetworkXError
        If `start` is not in `G`.

    Examples
    --------
    >>> G = nx.DiGraph([(1, 2), (1, 3), (2, 5), (3, 4), (4, 5)])
    >>> sorted((u, sorted(df)) for u, df in nx.dominance_frontiers(G, 1).items())
    [(1, []), (2, [5]), (3, [5]), (4, [5]), (5, [])]

    References
    ----------
    .. [1] K. D. Cooper, T. J. Harvey, and K. Kennedy.
           A simple, fast dominance algorithm.
           Software Practice & Experience, 4:110, 2001.
     N/A idom N/A N/A nx immediate_dominators G start N/A df N/A u N/A set N/A u idom N/A u idom N/A N/A N/A N/A len N/A N/A G pred N/A u 2 N/A N/A v N/A N/A G pred N/A u N/A N/A N/A v idom N/A N/A N/A v N/A idom N/A u N/A N/A N/A N/A N/A df N/A v add u N/A v N/A idom N/A v N/A df N/A