+
    �°³jU  ã                   ó¦   € R t ^ RIHt ^ RIt^ RIHt RR.t]! R4      ]P                  R 4       4       t	]! R4      ]P                  R 4       4       t
R# )	z
Dominance algorithms.
)ÚreduceN)Únot_implemented_forÚimmediate_dominatorsÚdominance_frontiersÚ
undirectedc                óÞ  aa	€ W9  d   \         P                  ! R4      hVR/o	\        \         P                  ! W4      4      p\	        V4       UUu/ uF  w  r4WCbK	  	  uppoVP                  4        VP                  4        VV	3R lpRpV'       dS   RpV FH  p\        VV	3R lV P                  V,           4       4      pVS	9  g   S	V,          V8w  g   KA  VS	V&   RpKJ  	  KZ  S	V S	# u uppi )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`, except for `start` itself.

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

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

Notes
-----
The immediate dominators are the parents of their corresponding nodes in
the dominator tree. Every node reachable from `start` has an immediate
dominator, except for `start` itself.

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

We can obtain the immediate post-dominators by reversing the graph
before calling ``immediate_dominators``.

>>> G = nx.DiGraph([(1, 2), (2, 3), (2, 4), (3, 5), (4, 5), (5, 6)])
>>> nx.immediate_dominators(G.reverse(copy=False), 6)
{5: 6, 4: 5, 3: 5, 2: 5, 1: 2}

References
----------
.. [1] Cooper, Keith D., Harvey, Timothy J. and Kennedy, Ken.
       "A simple, fast dominance algorithm." (2006).
       https://hdl.handle.net/1911/96345
.. [2] Lengauer, Thomas; Tarjan, Robert Endre (July 1979).
       "A fast algorithm for finding dominators in a flowgraph".
       ACM Transactions on Programming Languages and Systems. 1 (1): 121--141.
       https://dl.acm.org/doi/10.1145/357062.357071
zstart is not in GNc                 ó˜   <€ W8w  dC   SV ,          SV,          8  d   SV ,          p K   SV ,          SV,          8”  g   K=  SV,          pK"  V # ©N© )ÚuÚvÚdfnÚidoms   &&€€Ú^/home/luca/screen-checking/.venv/lib/python3.14/site-packages/networkx/algorithms/dominance.pyÚ	intersectÚ'immediate_dominators.<locals>.intersectO   s=   ø€ ØŒfØ�a•&˜3˜q�6”/Ø˜•G’Ø�a•&˜3˜q�6–/Ø˜•G’Øˆó    TFc              3   ó8   <"  € T F  qS9   g   K  Vx € K  	  R # 5ir	   r
   )Ú.0r   r   s   & €r   Ú	<genexpr>Ú'immediate_dominators.<locals>.<genexpr>[   s   øé € Ð)L±Y°ÀtÁ)¯!ª!³Yùs   ƒ�
)	ÚnxÚNetworkXErrorÚlistÚdfs_postorder_nodesÚ	enumerateÚpopÚreverser   Úpred)
ÚGÚstartÚorderÚir   r   ÚchangedÚnew_idomr   r   s
   &&      @@r   r   r      s×   ù€ ðp „~Ü×ÒÐ2Ó3Ð3à�4ˆ=€Dä”×'Ò'¨Ó1Ó2€EÜ% eÔ,Ô
-Ñ,‘D�Aˆ1Š4Ñ,Ò
-€CØ	‡I�I„KØ	‡M�M„Oöð €Gß
ØˆÛˆAÜ˜iÔ)L°Q·V±V¸A¶YÓ)LÓMˆHØ˜Œ}  Q¥¨8Ö 3Ø"��Q‘Ø’ó	 ð 	ˆUˆØ€Kùó- .s   ÁC)c                ó„  € \         P                  ! W4      VR/,          pV Uu/ uF  q3\        4       bK  	  ppV F|  pW18X  g$   \        V P                  V,          4      ^8¼  g   K,  V P                  V,           F9  pWR9   g   K  WRV,          8w  g   K  WE,          P                  V4       W%,          pK0  	  K~  	  V# u upi )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] Cooper, Keith D., Harvey, Timothy J. and Kennedy, Ken.
       "A simple, fast dominance algorithm." (2006).
       https://hdl.handle.net/1911/96345
N)r   r   ÚsetÚlenr   Úadd)r   r    r   r   Údfr   s   &&    r   r   r   d   sš   € ôN ×"Ò" 1Ó,°°t¨}Õ<€Dá Ó	!™D�qŒS‹UŠ(™D€BÐ	!ÛˆØŒ:œ˜QŸV™V A�Y›¨1Ö,Ø—V‘V˜A—Y�Y�Ø–9Ø A�wž,Ø�Ÿ	™	 !œØ �Gšó	 ñ ð €Iùò 
"s   ¤B=)Ú__doc__Ú	functoolsr   Únetworkxr   Únetworkx.utilsr   Ú__all__Ú_dispatchabler   r   r
   r   r   Ú<module>r0      sq   ðñõ ã Ý .à!Ð#8Ð
9€ñ �\Ó"Ø×ÑñRó ó #ðRñj �\Ó"Ø×Ññ/ó ó #ò/r   