+
    �°³jô,  ã                   ó^  € R t ^ RIt^ RIHt . ROt]! R4      ]P                  R 4       4       t]! R4      ]P                  RR l4       4       t]! R4      ]P                  R 4       4       t	]! R4      ]P                  R 4       4       t
]! R4      ]P                  ! RR	7      RR
 l4       4       tR# )zStrongly connected components.N)Únot_implemented_forÚ
undirectedc              #  ó°  "  € \        V 4      pV^ 8X  d   R# V P                  p/ p\        4       p. p. p. p. p^ p	V  EF  p
W£9   d   K  V	^,          p	T	pW“V
&   VP                  V
4       VP                  \	        W*,          4      4       VP                  R4       V'       g   Kg  VR,          pVR,           FÀ  pWÓ9  dS   V	^,          p	W“V&   VP                  V4       VP                  \	        W-,          4      4       VP                  R4        Kw  WÔ9  g   Kc  W<,          W=,          8”  g   Kx  RVR&   W=,          W<&   W<,          V8X  g   K–  W‘8X  g   Kž  \        V4      pVP                  V4       Vx €   R# 	  VP                  4        VP                  4        VP                  4       '       da   W<,          pV0pV'       d6   W8R,          ,          V8¼  d"   VP                  VP                  4       4       K=  VP                  V4       Vx € EKv  VP                  V4       VR,          pVV,          W<,          8”  g   EK§  RVR&   W<,          VV&   EKº  	  R# 5i)aö  Generate nodes in strongly connected components of graph.

Parameters
----------
G : NetworkX Graph
    A directed graph.

Returns
-------
comp : generator of sets
    A generator of sets of nodes, one for each strongly connected
    component of G.

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

Examples
--------
Generate a sorted list of strongly connected components, largest first.

>>> G = nx.cycle_graph(4, create_using=nx.DiGraph())
>>> nx.add_cycle(G, [10, 11, 12])
>>> [
...     len(c)
...     for c in sorted(nx.strongly_connected_components(G), key=len, reverse=True)
... ]
[4, 3]

If you only want the largest component, it's more efficient to
use max instead of sort.

>>> largest = max(nx.strongly_connected_components(G), key=len)

See Also
--------
connected_components
weakly_connected_components
kosaraju_strongly_connected_components

Notes
-----
Iterative version of Tarjan's algorithm using the improvements
described by Tarjan and Zwick in their survey [1]_, plus a trick
borrowed from the Rust implementation of the WebGraph framework [2]_.

References
----------
.. [1] Robert E. Tarjan and Uri Zwick, "Finding strong components using
   depth-first search", European Journal of Combinatorics, 119, 2024.
   https://doi.org/10.1016/j.ejc.2023.103815

.. [2] Tommaso Fontana, Sebastiano Vigna, and Stefano Zacchiroli,
   "WebGraph: The next generation (is in Rust)", Companion Proceedings
   of the ACM Web Conference 2024, pp. 686-689, 2024.
   https://doi.org/10.1145/3589335.3651581
NTFéÿÿÿÿ)ÚlenÚ_adjÚsetÚappendÚiterÚupdateÚpopÚadd)ÚGÚNÚadjÚlowlinkÚ	scc_foundÚdfs_vÚdfs_itÚdfs_leadÚ
comp_stackÚindexÚsourceÚroot_lowÚvÚwÚsccÚv_lowÚparents   &                Úr/home/luca/screen-checking/.venv/lib/python3.14/site-packages/networkx/algorithms/components/strongly_connected.pyÚstrongly_connected_componentsr       sð  é € ôz 	ˆA‹€AØˆA„vÙØ
�&‰&€Cð €GÜ“€Ið €EØ€FØ€Hà€JØ€EäˆØÔÙØ��
ˆØˆØ�‰Ø�‰�VÔØ�‰”d˜3�;Ó'Ô(Ø�‰˜Ôç‰eØ�b•	ˆAØ˜B—Z�Z�ØÔ#à˜Q•J�EØ!&˜A‘JØ—L‘L ”OØ—M‘M¤$ s¥v£,Ô/Ø—O‘O DÔ)ÚàÖ%¨'­*°wµzÖ*AØ#(�H˜R‘LØ!(¥�G‘Jð •z XÖ-°%¶*Ü! *›o˜ØŸ
™
 5Ô)Ø!š	Ûñ)  ð. —	‘	”Ø—
‘
”Ø—<‘<—>’>à#�J�EØ˜#�Cß$¨¸BµÕ)@ÀEÔ)IØŸ™ 
§¡Ó 0Ö1Ø×$Ñ$ SÔ)Ø•Ið ×%Ñ% aÔ(Ø" 2�Y�FØ˜v•¨­×3Ø',˜ ™Ø*1­*˜ œói ùs9   ‚BIÂ"A0IÄIÄ,IÅ
IÅAIÆ.IÇA8IÈ?Ic              #  ó6  "  € \        \        P                  ! V P                  RR7      VR7      4      p\	        V4      p\        4       pV'       dÇ   \	        V4      V8  dµ   VP                  4       pWT9   d   K0  V0pVP                  V4       V.pV'       dx   \	        V4      V8  dh   VP                  4       pV P                  V,           F>  p	W”9  g   K  VP                  V	4       VP                  V	4       VP                  V	4       K@  	  K  Vx € KÌ  R# R# 5i)a  Generate nodes in strongly connected components of graph.

Parameters
----------
G : NetworkX Graph
    A directed graph.

source : node, optional (default=None)
    Specify a node from which to start the depth-first search.
    If not provided, the algorithm will start from an arbitrary node.

Yields
------
set
    A set of all nodes in a strongly connected component of `G`.

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

NetworkXError
    If `source` is not a node in `G`.

Examples
--------
Generate a list of strongly connected components of a graph:

>>> G = nx.cycle_graph(4, create_using=nx.DiGraph())
>>> nx.add_cycle(G, [10, 11, 12])
>>> sorted(nx.kosaraju_strongly_connected_components(G), key=len, reverse=True)
[{0, 1, 2, 3}, {10, 11, 12}]

If you only want the largest component, it's more efficient to
use `max()` instead of `sorted()`.

>>> max(nx.kosaraju_strongly_connected_components(G), key=len)
{0, 1, 2, 3}

See Also
--------
strongly_connected_components

Notes
-----
Uses Kosaraju's algorithm.
F)Úcopy)r   N)
ÚlistÚnxÚdfs_postorder_nodesÚreverser   r   r   r   r   r	   )
r   r   ÚpostÚnÚseenÚrÚnewÚstackr   r   s
   &&        r   Ú&kosaraju_strongly_connected_componentsr-   –   sÓ   é € ôd ”×&Ò& q§y¡y°e yÓ'<ÀVÔLÓM€DÜˆD‹	€AÜ‹5€Dß
”3�t“9˜q”=Ø�H‰H‹JˆØŒ9ÙØˆcˆØ�‰�ŒØ�ˆßœ˜D›	 AœØ—	‘	“ˆAØ—V‘V˜A—Y�Y�Ø–=Ø—G‘G˜A”JØ—H‘H˜Q”KØ—L‘L –Oó	 ð
 Œ	ñ !‰$ùs   ‚ADÁADÂ9DÃADc                ó8   € \        R \        V 4       4       4      # )aE  Returns number of strongly connected components in graph.

Parameters
----------
G : NetworkX graph
   A directed graph.

Returns
-------
n : integer
   Number of strongly connected components

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

Examples
--------
>>> G = nx.DiGraph(
...     [(0, 1), (1, 2), (2, 0), (2, 3), (4, 5), (3, 4), (5, 6), (6, 3), (6, 7)]
... )
>>> nx.number_strongly_connected_components(G)
3

See Also
--------
strongly_connected_components
number_connected_components
number_weakly_connected_components

Notes
-----
For directed graphs only.
c              3   ó&   "  € T F  p^x € K	  	  R# 5i)é   N© )Ú.0r   s   & r   Ú	<genexpr>Ú7number_strongly_connected_components.<locals>.<genexpr>  s   é € Ð=Ñ<�S�qÓ<ùs   ‚)Úsumr    ©r   s   &r   Ú$number_strongly_connected_componentsr7   Ü   s   € ôL Ñ=Ô9¸!Ô<Ó=Ó=Ð=ó    c                ó    € \        V 4      ^ 8X  d   \        P                  ! R4      h\        \        \	        V 4      4      4      \        V 4      8H  # )aÓ  Test directed graph for strong connectivity.

A directed graph is strongly connected if and only if every vertex in
the graph is reachable from every other vertex.

Parameters
----------
G : NetworkX Graph
   A directed graph.

Returns
-------
connected : bool
  True if the graph is strongly connected, False otherwise.

Examples
--------
>>> G = nx.DiGraph([(0, 1), (1, 2), (2, 3), (3, 0), (2, 4), (4, 2)])
>>> nx.is_strongly_connected(G)
True
>>> G.remove_edge(2, 3)
>>> nx.is_strongly_connected(G)
False

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

See Also
--------
is_weakly_connected
is_semiconnected
is_connected
is_biconnected
strongly_connected_components

Notes
-----
For directed graphs only.
z-Connectivity is undefined for the null graph.)r   r$   ÚNetworkXPointlessConceptÚnextr    r6   s   &r   Úis_strongly_connectedr<     sG   € ôX ˆ1ƒv�„{Ü×)Ò)Ø?ó
ð 	
ô ŒtÔ1°!Ó4Ó5Ó6¼#¸a»&Ñ@Ð@r8   T)Úreturns_graphc                óà  aa€ Vf   \         P                  ! V 4      p/ o/ p\         P                  ! 4       pSVP                  R&   \	        V 4      ^ 8X  d   V# \        V4       F%  w  opWBS&   SP                  V3R lV 4       4       K'  	  S^,           pVP                  \        V4      4       VP                  V3R lV P                  4        4       4       \         P                  ! W2R4       V# )aÏ  Returns the condensation of G.

The condensation of G is the graph with each of the strongly connected
components contracted into a single node.

Parameters
----------
G : NetworkX DiGraph
   A directed graph.

scc:  list or generator (optional, default=None)
   Strongly connected components. If provided, the elements in
   `scc` must partition the nodes in `G`. If not provided, it will be
   calculated as scc=nx.strongly_connected_components(G).

Returns
-------
C : NetworkX DiGraph
   The condensation graph C of G.  The node labels are integers
   corresponding to the index of the component in the list of
   strongly connected components of G.  C has a graph attribute named
   'mapping' with a dictionary mapping the original nodes to the
   nodes in C to which they belong.  Each node in C also has a node
   attribute 'members' with the set of original nodes in G that
   form the SCC that the node in C represents.

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

Examples
--------
Contracting two sets of strongly connected nodes into two distinct SCC
using the barbell graph.

>>> G = nx.barbell_graph(4, 0)
>>> G.remove_edge(3, 4)
>>> G = nx.DiGraph(G)
>>> H = nx.condensation(G)
>>> H.nodes.data()
NodeDataView({0: {'members': {0, 1, 2, 3}}, 1: {'members': {4, 5, 6, 7}}})
>>> H.graph["mapping"]
{0: 0, 1: 0, 2: 0, 3: 0, 4: 1, 5: 1, 6: 1, 7: 1}

Contracting a complete graph into one single SCC.

>>> G = nx.complete_graph(7, create_using=nx.DiGraph)
>>> H = nx.condensation(G)
>>> H.nodes
NodeView((0,))
>>> H.nodes.data()
NodeDataView({0: {'members': {0, 1, 2, 3, 4, 5, 6}}})

Notes
-----
After contracting all strongly connected components to a single node,
the resulting graph is a directed acyclic graph.

Úmappingc              3   ó*   <"  € T F  qS3x € K
  	  R # 5i©Nr1   )r2   r(   Úis   & €r   r3   Úcondensation.<locals>.<genexpr>ƒ  s   øé € Ð1¡y !˜1•v£yùs   ƒc              3   óz   <"  € T F0  w  rSV,          SV,          8w  g   K  SV,          SV,          3x € K2  	  R # 5irA   r1   )r2   Úur   r?   s   &  €r   r3   rC   †  s6   øé € ð Ù-6¡T Q¸'À!½*ÈÐPQÍ
Ñ:RÔ ˆ���W˜Q•ZÕ «Yùs   ƒ;¡;Úmembers)r$   r    ÚDiGraphÚgraphr   Ú	enumerater   Úadd_nodes_fromÚrangeÚadd_edges_fromÚedgesÚset_node_attributes)r   r   rF   ÚCÚ	componentÚnumber_of_componentsrB   r?   s   &&    @@r   ÚcondensationrR   9  sÑ   ù€ ð~ ‚{Ü×.Ò.¨qÓ1ˆØ€GØ€GÜ
�
Š
‹€Aà €A‡G�GˆIÑÜ
ˆ1ƒv�„{ØˆÜ! #ž‰ˆˆ9Ø�‰
Ø�‰Ô1¡yÓ1Ö1ñ 'ð ˜q�5ÐØ×Ñ”UÐ/Ó0Ô1Ø×Ñô Ø-.¯W©W¬Yóô ô ×Ò˜1 yÔ1Ø€Hr8   )r7   r    r<   r-   rR   rA   )Ú__doc__Únetworkxr$   Únetworkx.utils.decoratorsr   Ú__all__Ú_dispatchabler    r-   r7   r<   rR   r1   r8   r   Ú<module>rX      sé   ðÙ $ã Ý 9ò€ñ �\Ó"Ø×ÑñB5ó ó #ðB5ñJ �\Ó"Ø×ÑóAó ó #ðAñH �\Ó"Ø×Ññ$>ó ó #ð$>ñN �\Ó"Ø×Ññ/Aó ó #ð/Añd �\Ó"Ø×Ò Ô%óPó &ó #òPr8   