§
    bŠtjú  ã                   óN   — d Z ddlZdgZ ej        d¬¦  «        dd„¦   «         ZdS )z
Flow Hierarchy.
é    NÚflow_hierarchyÚweight)Ú
edge_attrsc                 ó8  ‡ ‡— t          j        ‰ ¦  «        rt          j        d¦  «        ‚‰                      ¦   «         st          j        d¦  «        ‚t          j        ‰ ¦  «        }dt          ˆ ˆfd„|D ¦   «         ¦  «        ‰                      ‰¦  «        z  z
  S )aí  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_hierarchyé   c              3   óh   •K  — | ],}‰                      |¦  «                             ‰¦  «        V — Œ-d S ©N)ÚsubgraphÚsize)Ú.0ÚcÚGr   s     €€ú[/var/www/html/CA-Chatbot/venv/lib/python3.11/site-packages/networkx/algorithms/hierarchy.pyú	<genexpr>z!flow_hierarchy.<locals>.<genexpr>9   s;   øè è € Ð;Ð;°!�1—:’:˜a‘=”=×%Ò% fÑ-Ô-Ð;Ð;Ð;Ð;Ð;Ð;ó    )ÚnxÚis_emptyÚNetworkXErrorÚis_directedÚstrongly_connected_componentsÚsumr   )r   r   Úsccs   `` r   r   r   
   s—   øø€ õT 
„{�1�~„~ð PÝÔÐNÑOÔOÐOØ�=Š=‰?Œ?ð HÝÔÐFÑGÔGÐGÝ
Ô
*¨1Ñ
-Ô
-€CØ�sÐ;Ð;Ð;Ð;Ð;°sÐ;Ñ;Ô;Ñ;Ô;¸a¿fºfÀV¹n¼nÑLÑLÐLr   r	   )Ú__doc__Únetworkxr   Ú__all__Ú_dispatchabler   © r   r   ú<module>r      sf   ððð ð Ð Ð Ð àÐ
€ð €Ô˜XÐ&Ñ&Ô&ð.Mð .Mð .Mñ 'Ô&ð.Mð .Mð .Mr   