+
    �°³jî  ã                   ób   € R t ^ RIt^ RIHtHt R.t]! R4      ]P                  R 4       4       tR# )zSemiconnectedness.N)Únot_implemented_forÚpairwiseÚis_semiconnectedÚ
undirectedc                ó   a€ \        V 4      ^ 8X  d   \        P                  ! R4      h\        P                  ! V 4      '       g   R# \        P                  ! V 4      o\
        ;QJ d<    V3R l\        \        P                  ! S4      4       4       F  '       d   K   R# 	  R# ! V3R l\        \        P                  ! S4      4       4       4      # )a=  Returns True if the graph is semiconnected, False otherwise.

A graph is semiconnected if and only if for any pair of nodes, either one
is reachable from the other, or they are mutually reachable.

This function uses a theorem that states that a DAG is semiconnected
if for any topological sort, for node $v_n$ in that sort, there is an
edge $(v_i, v_{i+1})$. That allows us to check if a non-DAG `G` is
semiconnected by condensing the graph: i.e. constructing a new graph `H`
with nodes being the strongly connected components of `G`, and edges
(scc_1, scc_2) if there is a edge $(v_1, v_2)$ in `G` for some
$v_1 \in scc_1$ and $v_2 \in scc_2$. That results in a DAG, so we compute
the topological sort of `H` and check if for every $n$ there is an edge
$(scc_n, scc_{n+1})$.

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

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

Raises
------
NetworkXNotImplemented
    If the input graph is undirected.

NetworkXPointlessConcept
    If the graph is empty.

Examples
--------
>>> G = nx.path_graph(4, create_using=nx.DiGraph())
>>> print(nx.is_semiconnected(G))
True
>>> G = nx.DiGraph([(1, 2), (3, 2)])
>>> print(nx.is_semiconnected(G))
False

See Also
--------
is_strongly_connected
is_weakly_connected
is_connected
is_biconnected
z-Connectivity is undefined for the null graph.Fc              3   óJ   <"  € T F  w  rSP                  W4      x € K  	  R # 5i)N)Úhas_edge)Ú.0ÚuÚvÚHs   &  €Úm/home/luca/screen-checking/.venv/lib/python3.14/site-packages/networkx/algorithms/components/semiconnected.pyÚ	<genexpr>Ú#is_semiconnected.<locals>.<genexpr>G   s!   øé € ÐMÑ,L¡D Aˆq�z‰z˜!×ÐÓ,Lùs   ƒ #T)ÚlenÚnxÚNetworkXPointlessConceptÚis_weakly_connectedÚcondensationÚallr   Útopological_sort)ÚGr   s   &@r   r   r   	   s”   ø€ ôh ˆ1ƒv�„{Ü×)Ò)Ø;ó
ð 	
ô ×!Ò! !×$Ò$Ùä
�Š˜Ó€Aç‹3ÔM¬H´R×5HÒ5HÈÓ5KÔ,LÓM�3Œ3ÐMŠ3ÐMˆ3ÔM¬H´R×5HÒ5HÈÓ5KÔ,LÓMÓMÐMó    )	Ú__doc__Únetworkxr   Únetworkx.utilsr   r   Ú__all__Ú_dispatchabler   © r   r   Ú<module>r      s?   ðÙ ã ß 8àÐ
€ñ �\Ó"Ø×Ññ<Nó ó #ò<Nr   