+
    �°³j²  ã                   ó  € R t ^ RIHt ^ RIt^ RIHt . ROt]! R4      ]P                  RR l4       4       t	]! R4      ]P                  RR l4       4       t
]! R4      ]! R4      ]P                  ! RR	7      RR
 l4       4       4       tR# )zBridge-finding algorithms.)ÚchainN)Únot_implemented_forÚdirectedc              #  óú  "  € V P                  4       pV'       d   \        P                  ! V 4      MT p\        P                  ! W1R7      p\	        \
        P                  ! V4      4      pVe4   VP                  \        P                  ! W14      4      P                  4       pVP                  4        FE  w  rgWg3V9  g   K  Wv3V9  g   K  V'       d    \        W,          V,          4      ^8”  d   K@  Wg3x € KG  	  R# 5i)a”  Generate all bridges in a graph.

A *bridge* in a graph is an edge whose removal causes the number of
connected components of the graph to increase.  Equivalently, a bridge is an
edge that does not belong to any cycle. Bridges are also known as cut-edges,
isthmuses, or cut arcs.

Parameters
----------
G : undirected graph

root : node (optional)
   A node in the graph `G`. If specified, only the bridges in the
   connected component containing this node will be returned.

Yields
------
e : edge
   An edge in the graph whose removal disconnects the graph (or
   causes the number of connected components to increase).

Raises
------
NodeNotFound
   If `root` is not in the graph `G`.

NetworkXNotImplemented
    If `G` is a directed graph.

Examples
--------
The barbell graph with parameter zero has a single bridge:

>>> G = nx.barbell_graph(10, 0)
>>> list(nx.bridges(G))
[(9, 10)]

Notes
-----
This is an implementation of the algorithm described in [1]_.  An edge is a
bridge if and only if it is not contained in any chain. Chains are found
using the :func:`networkx.chain_decomposition` function.

The algorithm described in [1]_ requires a simple graph. If the provided
graph is a multigraph, we convert it to a simple graph and verify that any
bridges discovered by the chain decomposition algorithm are not multi-edges.

Ignoring polylogarithmic factors, the worst-case time complexity is the
same as the :func:`networkx.chain_decomposition` function,
$O(m + n)$, where $n$ is the number of nodes in the graph and $m$ is
the number of edges.

References
----------
.. [1] https://en.wikipedia.org/wiki/Bridge_%28graph_theory%29#Bridge-Finding_with_Chain_Decompositions
©ÚrootN)Úis_multigraphÚnxÚGraphÚchain_decompositionÚsetr   Úfrom_iterableÚsubgraphÚnode_connected_componentÚcopyÚedgesÚlen)ÚGr   Ú
multigraphÚHÚchainsÚchain_edgesÚuÚvs   &&      Ú\/home/luca/screen-checking/.venv/lib/python3.14/site-packages/networkx/algorithms/bridges.pyÚbridgesr      sµ   é € ðv —‘Ó"€Jß!Œ�Š�Œ q€AÜ×#Ò# AÔ1€FÜ”e×)Ò)¨&Ó1Ó2€KØÒØ�J‰J”r×2Ò2°1Ó;Ó<×AÑAÓCˆØ—‘–	‰ˆØˆ6˜Ö$¨!¨°{Ö)Bßœc !¥$ q¥'›l¨QÔ.ÙØ�$ŒJó	 ùs   ‚B8C;Â?C;Ã	C;Ã*C;c                óV   €  \        \        WR7      4       R#   \         d     R# i ; i)aP  Decide whether a graph has any bridges.

A *bridge* in a graph is an edge whose removal causes the number of
connected components of the graph to increase.

Parameters
----------
G : undirected graph

root : node (optional)
   A node in the graph `G`. If specified, only the bridges in the
   connected component containing this node will be considered.

Returns
-------
bool
   Whether the graph (or the connected component containing `root`)
   has any bridges.

Raises
------
NodeNotFound
   If `root` is not in the graph `G`.

NetworkXNotImplemented
    If `G` is a directed graph.

Examples
--------
The barbell graph with parameter zero has a single bridge::

    >>> G = nx.barbell_graph(10, 0)
    >>> nx.has_bridges(G)
    True

On the other hand, the cycle graph has no bridges::

    >>> G = nx.cycle_graph(5)
    >>> nx.has_bridges(G)
    False

Notes
-----
This implementation uses the :func:`networkx.bridges` function, so
it shares its worst-case time complexity, $O(m + n)$, ignoring
polylogarithmic factors, where $n$ is the number of nodes in the
graph and $m$ is the number of edges.

r   TF)Únextr   ÚStopIteration)r   r   s   &&r   Úhas_bridgesr   S   s.   € ðhÜŒW�QÔ"Ô#ñ øô ô Úðús   ‚ ™(§(r   Úweight)Ú
edge_attrsc              #  ó"  aa"  € VRJdL   V P                    F9  w  r4\        W,          4      \        W,          4      ,          '       d   K4  W43x € K;  	  R# \        P                  P	                  W4      oV P                    F]  w  r4\        W,          4      \        W,          4      ,          '       d   K4  W40oVV3R lp \        P
                  ! WWER7      pW4V3x € K_  	  R#   \        P                   d    Y4\        R4      3x €  KŠ  i ; i5i)aø  Iterate over local bridges of `G` optionally computing the span

A *local bridge* is an edge whose endpoints have no common neighbors.
That is, the edge is not part of a triangle in the graph.

The *span* of a *local bridge* is the shortest path length between
the endpoints if the local bridge is removed.

Parameters
----------
G : undirected graph

with_span : bool
    If True, yield a 3-tuple `(u, v, span)`

weight : function, string or None (default: None)
    If function, used to compute edge weights for the span.
    If string, the edge data attribute used in calculating span.
    If None, all edges have weight 1.

Yields
------
e : edge
    The local bridges as an edge 2-tuple of nodes `(u, v)` or
    as a 3-tuple `(u, v, span)` when `with_span is True`.

Raises
------
NetworkXNotImplemented
    If `G` is a directed graph or multigraph.

Examples
--------
A cycle graph has every edge a local bridge with span N-1.

   >>> G = nx.cycle_graph(9)
   >>> (0, 8, 8) in set(nx.local_bridges(G))
   True
Tc                 ó6   <€ V S9  g   VS9  d
   S! WV4      # R # ©N© )ÚnÚnbrÚdÚenodesÚwts   &&&€€r   Ú	hide_edgeÚ local_bridges.<locals>.hide_edgeÄ   s    ø€ Ø ”¨#°VÔ*;Ù! !¨!›}Ð,Ùó    )r    ÚinfN)r   r   r	   ÚweightedÚ_weight_functionÚshortest_path_lengthÚNetworkXNoPathÚfloat)	r   Ú	with_spanr    r   r   r+   Úspanr)   r*   s	   &&&    @@r   Úlocal_bridgesr6   �   sÎ   ùé € ðV ˜ÓØ—G”G‰DˆAÜ˜�“I¤ A¥D£	×)Ö)Ø�d”
ó ô �[‰[×)Ñ)¨!Ó4ˆØ—G”G‰DˆAÜ˜�“I¤ A¥D£	×)Ö)Ø˜�ö ð
-Ü×2Ò2°1¸ÔM�DØ ˜*Ô$ó øô ×(Ñ(ô -Ø¤ e£Ð,Õ,ð-üs7   „ADÁA%DÂ5
DÃ C$ÃDÃ$$DÄDÄDÄD)r   r   r6   r$   )TN)Ú__doc__Ú	itertoolsr   Únetworkxr	   Únetworkx.utilsr   Ú__all__Ú_dispatchabler   r   r6   r%   r-   r   Ú<module>r=      s¡   ðÙ  å ã Ý .â
5€ñ �ZÓ Ø×ÑóCó ó !ðCñL �ZÓ Ø×Ñó7ó ó !ð7ñt �\Ó"Ù�ZÓ Ø×Ò˜XÔ&ó;-ó 'ó !ó #ò;-r-   