+
    �°³jú  ã                   óN   € R t ^ RItR.t]P                  ! RR7      RR l4       tR# )z
Flow Hierarchy.
NÚflow_hierarchyÚweight)Ú
edge_attrsc                óT  a a€ \         P                  ! S 4      '       d   \         P                  ! R4      hS P                  4       '       g   \         P                  ! R4      h\         P                  ! S 4      p^\        V V3R lV 4       4      S P                  S4      ,          ,
          # )aq  Returns the flow hierarchy of a directed network.

Flow hierarchy is defined as the fraction of edges not participating
in cycles in a directed graph [1]_.

Parameters
----------
G : DiGraph or MultiDiGraph
   A directed graph

weight : string, optional (default=None)
   Attribute to use for edge weights. If None the weight defaults to 1.

Returns
-------
h : float
   Flow hierarchy value

Raises
------
NetworkXError
   If `G` is not a directed graph or if `G` has no edges.

Notes
-----
The algorithm described in [1]_ computes the flow hierarchy through
exponentiation of the adjacency matrix.  This function implements an
alternative approach that finds strongly connected components.
An edge is in a cycle if and only if it is in a strongly connected
component, which can be found in $O(m)$ time using Tarjan's algorithm.

References
----------
.. [1] Luo, J.; Magee, C.L. (2011),
   Detecting evolving patterns of self-organizing networks by flow
   hierarchy measurement, Complexity, Volume 16 Issue 6 53-61.
   DOI: 10.1002/cplx.20368
   http://web.mit.edu/~cmagee/www/documents/28-DetectingEvolvingPatterns_FlowHierarchy.pdf
z-flow_hierarchy not applicable to empty graphsz%G must be a digraph in flow_hierarchyc              3   ód   <"  € T F%  pSP                  V4      P                  S4      x € K'  	  R # 5i©N)ÚsubgraphÚsize)Ú.0ÚcÚGr   s   & €€Ú^/home/luca/screen-checking/.venv/lib/python3.14/site-packages/networkx/algorithms/hierarchy.pyÚ	<genexpr>Ú!flow_hierarchy.<locals>.<genexpr>9   s'   øé € Ð;±s°!�1—:‘:˜a“=×%Ñ% f×-Ð-³sùs   ƒ-0)ÚnxÚis_emptyÚNetworkXErrorÚis_directedÚstrongly_connected_componentsÚsumr	   )r   r   Úsccs   ff r   r   r   
   su   ù€ ôT 
‡{‚{�1‡~‚~Ü×ÒÐNÓOÐOØ�=‰=�?Š?Ü×ÒÐFÓGÐGÜ
×
*Ò
*¨1Ó
-€CØŒsÕ;±sÓ;Ó;¸a¿f¹fÀV»nÕLÕLÐLó    r   )Ú__doc__Únetworkxr   Ú__all__Ú_dispatchabler   © r   r   Ú<module>r      s8   ðñó àÐ
€ð ×Ò˜XÔ&ó.Mó 'ò.Mr   