
    hr                     t   S r SSKrSSKJr  SSKrSSKJrJrJ	r	J
r
JrJr  \
rSSKJrJr  / SQr\R$                  " SSS	.S
1S9 SS j5       r\R$                  SS j5       r\R$                  SS j5       r\R$                  SS j5       r\R$                  " SSS	.S9 SS j5       r\R$                  SS j5       rg)z$
Flow based connectivity algorithms
    N)
itemgetter)boykov_kolmogorovbuild_residual_networkdinitzedmonds_karppreflow_pushshortest_augmenting_path   )!build_auxiliary_edge_connectivity!build_auxiliary_node_connectivity)average_node_connectivitylocal_node_connectivitynode_connectivitylocal_edge_connectivityedge_connectivityall_pairs_node_connectivity   )Gz
auxiliary?	auxiliary)graphspreserve_graph_attrsc                 $   Uc  [         nUc  [        U 5      nOUnUR                  R                  SS5      nUc  [        R
                  " S5      eX5S.n	U[        La  XiS'   U[        L a  SU	S'   [        R                  " XxU    S3X    S	340 U	D6$ )
aH  Computes local node connectivity for nodes s and t.

Local node connectivity for two non adjacent nodes s and t is the
minimum number of nodes that must be removed (along with their incident
edges) to disconnect them.

This is a flow based implementation of node connectivity. We compute the
maximum flow on an auxiliary digraph build from the original input
graph (see below for details).

Parameters
----------
G : NetworkX graph
    Undirected graph

s : node
    Source node

t : node
    Target node

flow_func : function
    A function for computing the maximum flow among a pair of nodes.
    The function has to accept at least three parameters: a Digraph,
    a source node, and a target node. And return a residual network
    that follows NetworkX conventions (see :meth:`maximum_flow` for
    details). If flow_func is None, the default maximum flow function
    (:meth:`edmonds_karp`) is used. See below for details. The choice
    of the default function may change from version to version and
    should not be relied on. Default value: None.

auxiliary : NetworkX DiGraph
    Auxiliary digraph to compute flow based node connectivity. It has
    to have a graph attribute called mapping with a dictionary mapping
    node names in G and in the auxiliary digraph. If provided
    it will be reused instead of recreated. Default value: None.

residual : NetworkX DiGraph
    Residual network to compute maximum flow. If provided it will be
    reused instead of recreated. Default value: None.

cutoff : integer, float, or None (default: None)
    If specified, the maximum flow algorithm will terminate when the
    flow value reaches or exceeds the cutoff. This only works for flows
    that support the cutoff parameter (most do) and is ignored otherwise.

Returns
-------
K : integer
    local node connectivity for nodes s and t

Examples
--------
This function is not imported in the base NetworkX namespace, so you
have to explicitly import it from the connectivity package:

>>> from networkx.algorithms.connectivity import local_node_connectivity

We use in this example the platonic icosahedral graph, which has node
connectivity 5.

>>> G = nx.icosahedral_graph()
>>> local_node_connectivity(G, 0, 6)
5

If you need to compute local connectivity on several pairs of
nodes in the same graph, it is recommended that you reuse the
data structures that NetworkX uses in the computation: the
auxiliary digraph for node connectivity, and the residual
network for the underlying maximum flow computation.

Example of how to compute local node connectivity among
all pairs of nodes of the platonic icosahedral graph reusing
the data structures.

>>> import itertools
>>> # You also have to explicitly import the function for
>>> # building the auxiliary digraph from the connectivity package
>>> from networkx.algorithms.connectivity import build_auxiliary_node_connectivity
>>> H = build_auxiliary_node_connectivity(G)
>>> # And the function for building the residual network from the
>>> # flow package
>>> from networkx.algorithms.flow import build_residual_network
>>> # Note that the auxiliary digraph has an edge attribute named capacity
>>> R = build_residual_network(H, "capacity")
>>> result = dict.fromkeys(G, dict())
>>> # Reuse the auxiliary digraph and the residual network by passing them
>>> # as parameters
>>> for u, v in itertools.combinations(G, 2):
...     k = local_node_connectivity(G, u, v, auxiliary=H, residual=R)
...     result[u][v] = k
>>> all(result[u][v] == 5 for u, v in itertools.combinations(G, 2))
True

You can also use alternative flow algorithms for computing node
connectivity. For instance, in dense networks the algorithm
:meth:`shortest_augmenting_path` will usually perform better than
the default :meth:`edmonds_karp` which is faster for sparse
networks with highly skewed degree distributions. Alternative flow
functions have to be explicitly imported from the flow package.

>>> from networkx.algorithms.flow import shortest_augmenting_path
>>> local_node_connectivity(G, 0, 6, flow_func=shortest_augmenting_path)
5

Notes
-----
This is a flow based implementation of node connectivity. We compute the
maximum flow using, by default, the :meth:`edmonds_karp` algorithm (see:
:meth:`maximum_flow`) on an auxiliary digraph build from the original
input graph:

For an undirected graph G having `n` nodes and `m` edges we derive a
directed graph H with `2n` nodes and `2m+n` arcs by replacing each
original node `v` with two nodes `v_A`, `v_B` linked by an (internal)
arc in H. Then for each edge (`u`, `v`) in G we add two arcs
(`u_B`, `v_A`) and (`v_B`, `u_A`) in H. Finally we set the attribute
capacity = 1 for each arc in H [1]_ .

For a directed graph G having `n` nodes and `m` arcs we derive a
directed graph H with `2n` nodes and `m+n` arcs by replacing each
original node `v` with two nodes `v_A`, `v_B` linked by an (internal)
arc (`v_A`, `v_B`) in H. Then for each arc (`u`, `v`) in G we add one arc
(`u_B`, `v_A`) in H. Finally we set the attribute capacity = 1 for
each arc in H.

This is equal to the local node connectivity because the value of
a maximum s-t-flow is equal to the capacity of a minimum s-t-cut.

See also
--------
:meth:`local_edge_connectivity`
:meth:`node_connectivity`
:meth:`minimum_node_cut`
:meth:`maximum_flow`
:meth:`edmonds_karp`
:meth:`preflow_push`
:meth:`shortest_augmenting_path`

References
----------
.. [1] Kammer, Frank and Hanjo Taubig. Graph Connectivity. in Brandes and
    Erlebach, 'Network Analysis: Methodological Foundations', Lecture
    Notes in Computer Science, Volume 3418, Springer-Verlag, 2005.
    http://www.informatik.uni-augsburg.de/thi/personen/kammer/Graph_Connectivity.pdf

NmappingzInvalid auxiliary digraph.	flow_funcresidualcutoffT	two_phaseBA)	default_flow_funcr   graphgetnxNetworkXErrorr   r	   maximum_flow_value)
r   str   r   r   r   Hr   kwargss
             _/var/www/html/env/lib/python3.13/site-packages/networkx/algorithms/connectivity/connectivity.pyr   r   #   s    n %	-a0ggkk)T*G;<<$;F$!x,,"{  qzl!$4A6FQ&QQ    c           	      n  ^  Ub  Ub  Uc  Ub  [         R                  " S5      eUbN  UbK  UT ;  a  [         R                  " SU S35      eUT ;  a  [         R                  " SU S35      e[        T XUS9$ T R                  5       (       a3  [         R                  " T 5      (       d  g[
        R                  nU 4S jnO8[         R                  " T 5      (       d  g[
        R                  nT R                  n[        T 5      n[        US5      nX6US.n[        T R                  5       [        S	5      S
9u  p[        T 5      [        U" U	5      5      -
  U	1-
   H  nXS'   [        U
[        T X40 UD65      n
M      U" U" U	5      S5       H+  u  pUT U   ;   a  M  XS'   [        U
[        T X40 UD65      n
M-     U
$ )a  Returns node connectivity for a graph or digraph G.

Node connectivity is equal to the minimum number of nodes that
must be removed to disconnect G or render it trivial. If source
and target nodes are provided, this function returns the local node
connectivity: the minimum number of nodes that must be removed to break
all paths from source to target in G.

Parameters
----------
G : NetworkX graph
    Undirected graph

s : node
    Source node. Optional. Default value: None.

t : node
    Target node. Optional. Default value: None.

flow_func : function
    A function for computing the maximum flow among a pair of nodes.
    The function has to accept at least three parameters: a Digraph,
    a source node, and a target node. And return a residual network
    that follows NetworkX conventions (see :meth:`maximum_flow` for
    details). If flow_func is None, the default maximum flow function
    (:meth:`edmonds_karp`) is used. See below for details. The
    choice of the default function may change from version
    to version and should not be relied on. Default value: None.

Returns
-------
K : integer
    Node connectivity of G, or local node connectivity if source
    and target are provided.

Examples
--------
>>> # Platonic icosahedral graph is 5-node-connected
>>> G = nx.icosahedral_graph()
>>> nx.node_connectivity(G)
5

You can use alternative flow algorithms for the underlying maximum
flow computation. In dense networks the algorithm
:meth:`shortest_augmenting_path` will usually perform better
than the default :meth:`edmonds_karp`, which is faster for
sparse networks with highly skewed degree distributions. Alternative
flow functions have to be explicitly imported from the flow package.

>>> from networkx.algorithms.flow import shortest_augmenting_path
>>> nx.node_connectivity(G, flow_func=shortest_augmenting_path)
5

If you specify a pair of nodes (source and target) as parameters,
this function returns the value of local node connectivity.

>>> nx.node_connectivity(G, 3, 7)
5

If you need to perform several local computations among different
pairs of nodes on the same graph, it is recommended that you reuse
the data structures used in the maximum flow computations. See
:meth:`local_node_connectivity` for details.

Notes
-----
This is a flow based implementation of node connectivity. The
algorithm works by solving $O((n-\delta-1+\delta(\delta-1)/2))$
maximum flow problems on an auxiliary digraph. Where $\delta$
is the minimum degree of G. For details about the auxiliary
digraph and the computation of local node connectivity see
:meth:`local_node_connectivity`. This implementation is based
on algorithm 11 in [1]_.

See also
--------
:meth:`local_node_connectivity`
:meth:`edge_connectivity`
:meth:`maximum_flow`
:meth:`edmonds_karp`
:meth:`preflow_push`
:meth:`shortest_augmenting_path`

References
----------
.. [1] Abdol-Hossein Esfahanian. Connectivity Algorithms.
    http://www.cse.msu.edu/~cse835/Papers/Graph_connectivity_revised.pdf

)Both source and target must be specified.node  not in graph)r   r   c                    > [         R                  R                  TR                  U 5      TR	                  U 5      /5      $ N)	itertoolschainfrom_iterablepredecessors
successors)vr   s    r+   	neighbors$node_connectivity.<locals>.neighbors?  s/    ??00!..2CQ\\RS_1UVVr,   capacityr   r   r   r
   )keyr      )r$   r%   r   is_directedis_weakly_connectedr3   permutationsis_connectedcombinationsr9   r   r   mindegreer   set)r   r'   r(   r   	iter_funcr9   r)   Rr*   r8   Kwxys   `             r+   r   r      s   v 	
!)q}JKK 	}A:""U1#]#;<<A:""U1#]#;<<&q!)DD 	}}%%a((**		W q!!**	KK	 	*!,Aq*-A$!DF qxxzz!}-DAVc)A,''1#-x*1a=f=> . )A,*!9x*1a=f=>	 + Hr,   c                    U R                  5       (       a  [        R                  nO[        R                  n[	        U 5      n[        US5      nXUS.nSu  pgU" U S5       H  u  pU[        XU	40 UD6-  nUS-  nM     US:X  a  gXg-  $ )az  Returns the average connectivity of a graph G.

The average connectivity `\bar{\kappa}` of a graph G is the average
of local node connectivity over all pairs of nodes of G [1]_ .

.. math::

    \bar{\kappa}(G) = \frac{\sum_{u,v} \kappa_{G}(u,v)}{{n \choose 2}}

Parameters
----------

G : NetworkX graph
    Undirected graph

flow_func : function
    A function for computing the maximum flow among a pair of nodes.
    The function has to accept at least three parameters: a Digraph,
    a source node, and a target node. And return a residual network
    that follows NetworkX conventions (see :meth:`maximum_flow` for
    details). If flow_func is None, the default maximum flow function
    (:meth:`edmonds_karp`) is used. See :meth:`local_node_connectivity`
    for details. The choice of the default function may change from
    version to version and should not be relied on. Default value: None.

Returns
-------
K : float
    Average node connectivity

See also
--------
:meth:`local_node_connectivity`
:meth:`node_connectivity`
:meth:`edge_connectivity`
:meth:`maximum_flow`
:meth:`edmonds_karp`
:meth:`preflow_push`
:meth:`shortest_augmenting_path`

References
----------
.. [1]  Beineke, L., O. Oellermann, and R. Pippert (2002). The average
        connectivity of a graph. Discrete mathematics 252(1-3), 31-45.
        http://www.sciencedirect.com/science/article/pii/S0012365X01001807

r;   r<   )r   r   r>   r
   r   )r?   r3   rA   rC   r   r   r   )
r   r   rG   r)   rH   r*   numdenur8   s
             r+   r   r   ^  s    b 	}}**	**	 	*!,Aq*-A$!DFHC!Q&qQ9&99q   ax9r,   c                    Uc  U nO[        U5      nU R                  5       nU(       a  [        R                  nO[        R                  nU Vs0 s H  oU0 _M     nn[        U 5      nUR                  S   n[        US5      n	X'U	S.n
U" US5       H)  u  p[        XU40 U
D6nXU   U'   U(       a  M"  XU   U'   M+     U$ s  snf )a|  Compute node connectivity between all pairs of nodes of G.

Parameters
----------
G : NetworkX graph
    Undirected graph

nbunch: container
    Container of nodes. If provided node connectivity will be computed
    only over pairs of nodes in nbunch.

flow_func : function
    A function for computing the maximum flow among a pair of nodes.
    The function has to accept at least three parameters: a Digraph,
    a source node, and a target node. And return a residual network
    that follows NetworkX conventions (see :meth:`maximum_flow` for
    details). If flow_func is None, the default maximum flow function
    (:meth:`edmonds_karp`) is used. See below for details. The
    choice of the default function may change from version
    to version and should not be relied on. Default value: None.

Returns
-------
all_pairs : dict
    A dictionary with node connectivity between all pairs of nodes
    in G, or in nbunch if provided.

See also
--------
:meth:`local_node_connectivity`
:meth:`edge_connectivity`
:meth:`local_edge_connectivity`
:meth:`maximum_flow`
:meth:`edmonds_karp`
:meth:`preflow_push`
:meth:`shortest_augmenting_path`

r   r;   r<   r>   )	rF   r?   r3   rA   rC   r   r"   r   r   )r   nbunchr   directedrG   n	all_pairsr)   r   rH   r*   rP   r8   rI   s                 r+   r   r     s    P ~V}}H**	**	 &'1BI' 	*!,Aggi Gq*-A$!DF&!$#A!6v6!QxaLO	 %  (s   B?)r   c                     Uc  [         nUc  [        U 5      nOUnX5S.nU[        La  XhS'   U[        L a  SUS'   [        R
                  " XqU40 UD6$ )a  Returns local edge connectivity for nodes s and t in G.

Local edge connectivity for two nodes s and t is the minimum number
of edges that must be removed to disconnect them.

This is a flow based implementation of edge connectivity. We compute the
maximum flow on an auxiliary digraph build from the original
network (see below for details). This is equal to the local edge
connectivity because the value of a maximum s-t-flow is equal to the
capacity of a minimum s-t-cut (Ford and Fulkerson theorem) [1]_ .

Parameters
----------
G : NetworkX graph
    Undirected or directed graph

s : node
    Source node

t : node
    Target node

flow_func : function
    A function for computing the maximum flow among a pair of nodes.
    The function has to accept at least three parameters: a Digraph,
    a source node, and a target node. And return a residual network
    that follows NetworkX conventions (see :meth:`maximum_flow` for
    details). If flow_func is None, the default maximum flow function
    (:meth:`edmonds_karp`) is used. See below for details. The
    choice of the default function may change from version
    to version and should not be relied on. Default value: None.

auxiliary : NetworkX DiGraph
    Auxiliary digraph for computing flow based edge connectivity. If
    provided it will be reused instead of recreated. Default value: None.

residual : NetworkX DiGraph
    Residual network to compute maximum flow. If provided it will be
    reused instead of recreated. Default value: None.

cutoff : integer, float, or None (default: None)
    If specified, the maximum flow algorithm will terminate when the
    flow value reaches or exceeds the cutoff. This only works for flows
    that support the cutoff parameter (most do) and is ignored otherwise.

Returns
-------
K : integer
    local edge connectivity for nodes s and t.

Examples
--------
This function is not imported in the base NetworkX namespace, so you
have to explicitly import it from the connectivity package:

>>> from networkx.algorithms.connectivity import local_edge_connectivity

We use in this example the platonic icosahedral graph, which has edge
connectivity 5.

>>> G = nx.icosahedral_graph()
>>> local_edge_connectivity(G, 0, 6)
5

If you need to compute local connectivity on several pairs of
nodes in the same graph, it is recommended that you reuse the
data structures that NetworkX uses in the computation: the
auxiliary digraph for edge connectivity, and the residual
network for the underlying maximum flow computation.

Example of how to compute local edge connectivity among
all pairs of nodes of the platonic icosahedral graph reusing
the data structures.

>>> import itertools
>>> # You also have to explicitly import the function for
>>> # building the auxiliary digraph from the connectivity package
>>> from networkx.algorithms.connectivity import build_auxiliary_edge_connectivity
>>> H = build_auxiliary_edge_connectivity(G)
>>> # And the function for building the residual network from the
>>> # flow package
>>> from networkx.algorithms.flow import build_residual_network
>>> # Note that the auxiliary digraph has an edge attribute named capacity
>>> R = build_residual_network(H, "capacity")
>>> result = dict.fromkeys(G, dict())
>>> # Reuse the auxiliary digraph and the residual network by passing them
>>> # as parameters
>>> for u, v in itertools.combinations(G, 2):
...     k = local_edge_connectivity(G, u, v, auxiliary=H, residual=R)
...     result[u][v] = k
>>> all(result[u][v] == 5 for u, v in itertools.combinations(G, 2))
True

You can also use alternative flow algorithms for computing edge
connectivity. For instance, in dense networks the algorithm
:meth:`shortest_augmenting_path` will usually perform better than
the default :meth:`edmonds_karp` which is faster for sparse
networks with highly skewed degree distributions. Alternative flow
functions have to be explicitly imported from the flow package.

>>> from networkx.algorithms.flow import shortest_augmenting_path
>>> local_edge_connectivity(G, 0, 6, flow_func=shortest_augmenting_path)
5

Notes
-----
This is a flow based implementation of edge connectivity. We compute the
maximum flow using, by default, the :meth:`edmonds_karp` algorithm on an
auxiliary digraph build from the original input graph:

If the input graph is undirected, we replace each edge (`u`,`v`) with
two reciprocal arcs (`u`, `v`) and (`v`, `u`) and then we set the attribute
'capacity' for each arc to 1. If the input graph is directed we simply
add the 'capacity' attribute. This is an implementation of algorithm 1
in [1]_.

The maximum flow in the auxiliary network is equal to the local edge
connectivity because the value of a maximum s-t-flow is equal to the
capacity of a minimum s-t-cut (Ford and Fulkerson theorem).

See also
--------
:meth:`edge_connectivity`
:meth:`local_node_connectivity`
:meth:`node_connectivity`
:meth:`maximum_flow`
:meth:`edmonds_karp`
:meth:`preflow_push`
:meth:`shortest_augmenting_path`

References
----------
.. [1] Abdol-Hossein Esfahanian. Connectivity Algorithms.
    http://www.cse.msu.edu/~cse835/Papers/Graph_connectivity_revised.pdf

r   r   Tr   )r!   r   r   r	   r$   r&   )	r   r'   r(   r   r   r   r   r)   r*   s	            r+   r   r     sh    X %	-a0$;F$!x,,"{  q3F33r,   c                 "   Ub  Ub  Uc  Ub  [         R                  " S5      eUbL  UbI  X;  a  [         R                  " SU S35      eX ;  a  [         R                  " SU S35      e[        XX#US9$ [        U 5      n[	        US5      nX5US.nU R                  5       (       a  [         R                  " U 5      (       d  g[        S U R                  5        5       5      n[        U 5      n	[        U	5      n
Ub  [        XH5      n[        U
5       H'  nXS	'    [        U[        X	U   XS
-      40 UD65      nM)     U$ [         R                  " U 5      (       d  g[        S U R                  5        5       5      nUb  [        XH5      nU  H0  n[         R                  " XS9nUR                  5       nU(       d  M0    O   U$ U H  nXS	'   [        U[        XU40 UD65      nM      U$ ! [         a!    [        U[        X	U   U	S   40 UD65      n M  f = f)a  Returns the edge connectivity of the graph or digraph G.

The edge connectivity is equal to the minimum number of edges that
must be removed to disconnect G or render it trivial. If source
and target nodes are provided, this function returns the local edge
connectivity: the minimum number of edges that must be removed to
break all paths from source to target in G.

Parameters
----------
G : NetworkX graph
    Undirected or directed graph

s : node
    Source node. Optional. Default value: None.

t : node
    Target node. Optional. Default value: None.

flow_func : function
    A function for computing the maximum flow among a pair of nodes.
    The function has to accept at least three parameters: a Digraph,
    a source node, and a target node. And return a residual network
    that follows NetworkX conventions (see :meth:`maximum_flow` for
    details). If flow_func is None, the default maximum flow function
    (:meth:`edmonds_karp`) is used. See below for details. The
    choice of the default function may change from version
    to version and should not be relied on. Default value: None.

cutoff : integer, float, or None (default: None)
    If specified, the maximum flow algorithm will terminate when the
    flow value reaches or exceeds the cutoff. This only works for flows
    that support the cutoff parameter (most do) and is ignored otherwise.

Returns
-------
K : integer
    Edge connectivity for G, or local edge connectivity if source
    and target were provided

Examples
--------
>>> # Platonic icosahedral graph is 5-edge-connected
>>> G = nx.icosahedral_graph()
>>> nx.edge_connectivity(G)
5

You can use alternative flow algorithms for the underlying
maximum flow computation. In dense networks the algorithm
:meth:`shortest_augmenting_path` will usually perform better
than the default :meth:`edmonds_karp`, which is faster for
sparse networks with highly skewed degree distributions.
Alternative flow functions have to be explicitly imported
from the flow package.

>>> from networkx.algorithms.flow import shortest_augmenting_path
>>> nx.edge_connectivity(G, flow_func=shortest_augmenting_path)
5

If you specify a pair of nodes (source and target) as parameters,
this function returns the value of local edge connectivity.

>>> nx.edge_connectivity(G, 3, 7)
5

If you need to perform several local computations among different
pairs of nodes on the same graph, it is recommended that you reuse
the data structures used in the maximum flow computations. See
:meth:`local_edge_connectivity` for details.

Notes
-----
This is a flow based implementation of global edge connectivity.
For undirected graphs the algorithm works by finding a 'small'
dominating set of nodes of G (see algorithm 7 in [1]_ ) and
computing local maximum flow (see :meth:`local_edge_connectivity`)
between an arbitrary node in the dominating set and the rest of
nodes in it. This is an implementation of algorithm 6 in [1]_ .
For directed graphs, the algorithm does n calls to the maximum
flow function. This is an implementation of algorithm 8 in [1]_ .

See also
--------
:meth:`local_edge_connectivity`
:meth:`local_node_connectivity`
:meth:`node_connectivity`
:meth:`maximum_flow`
:meth:`edmonds_karp`
:meth:`preflow_push`
:meth:`shortest_augmenting_path`
:meth:`k_edge_components`
:meth:`k_edge_subgraphs`

References
----------
.. [1] Abdol-Hossein Esfahanian. Connectivity Algorithms.
    http://www.cse.msu.edu/~cse835/Papers/Graph_connectivity_revised.pdf

r.   r/   r0   )r   r   r;   r<   r   c              3   *   #    U  H	  u  pUv   M     g 7fr2    .0rT   ds      r+   	<genexpr>$edge_connectivity.<locals>.<genexpr>       )jdaj   r   r
   c              3   *   #    U  H	  u  pUv   M     g 7fr2   rY   rZ   s      r+   r]   r^     r_   r`   )
start_with)r$   r%   r   r   r   r?   r@   rD   rE   listlenrange
IndexErrorrB   dominating_setpop)r   r'   r(   r   r   r)   rH   r*   LnodesrT   inodeDr8   rJ   s                   r+   r   r     s   J 	
!)q}JKK 	}:""U1#]#;<<:""U1#]#;<<&qQFSS 	*!,Aq*-A$!DF}}%%a(( )ahhj))QJFAqA 8U21Ah!eWPVWX   q!! )ahhj))FA D!!!5AAq	  HA 8A.qQA&ABA  =  U21AhaSFSTUs   G##'HH)NNNN)NNNr2   )NN)__doc__r3   operatorr   networkxr$   networkx.algorithms.flowr   r   r   r   r   r	   r!   utilsr   r   __all___dispatchabler   r   r   r   r   r   rY   r,   r+   <module>ru      s        !  W q2+WCGjR XjRZ I IX A AH @ @F q23CG[4 4[4| d dr,   