§
    bŠtjn  ã                   óN   — d Z ddlZdgZ ej        d¬¦  «        dd„¦   «         ZdS )z
Spectral bipartivity measure.
é    NÚspectral_bipartivityÚweight)Ú
edge_attrsc           
      óx  — ddl }t          | ¦  «        }t          j        | ||¬¦  «        }|j                             |¦  «        }|j                             | ¦  «        }d||z   z  }|€Zt          |                     ¦   «                              ¦   «         |                     ¦   «                              ¦   «         z  ¦  «        S t          t          |t          t          |¦  «        ¦  «        ¦  «        ¦  «        }	i }
|D ]:}|	|         }|                     ||¦  «        |                     ||¦  «        z  |
|<   Œ;|
S )u9  Returns the spectral bipartivity.

    Parameters
    ----------
    G : NetworkX graph

    nodes : list or container  optional(default is all nodes)
      Nodes to return value of spectral bipartivity contribution.

    weight : string or None  optional (default = 'weight')
      Edge data key to use for edge weights. If None, weights set to 1.

    Returns
    -------
    sb : float or dict
       A single number if the keyword nodes is not specified, or
       a dictionary keyed by node with the spectral bipartivity contribution
       of that node as the value.

    Examples
    --------
    >>> from networkx.algorithms import bipartite
    >>> G = nx.path_graph(4)
    >>> bipartite.spectral_bipartivity(G)
    1.0

    Notes
    -----
    This implementation uses Numpy (dense) matrices which are not efficient
    for storing large sparse graphs.

    See Also
    --------
    color

    References
    ----------
    .. [1] E. Estrada and J. A. RodrÃ­guez-VelÃ¡zquez, "Spectral measures of
       bipartivity in complex networks", PhysRev E 72, 046105 (2005)
    r   N)r   g      à?)ÚscipyÚlistÚnxÚto_numpy_arrayÚlinalgÚexpmÚfloatÚdiagonalÚsumÚdictÚzipÚrangeÚlenÚitem)ÚGÚnodesr   ÚspÚnodelistÚAÚexpAÚexpmAÚcoshAÚindexÚsbÚnÚis                úd/var/www/html/CA-Chatbot/venv/lib/python3.11/site-packages/networkx/algorithms/bipartite/spectral.pyr   r   
   s  € ðT ÐÐÐå�A‰wŒw€HÝ
Ô˜!˜X¨fÐ5Ñ5Ô5€AØŒ9�>Š>˜!ÑÔ€DØŒI�NŠN˜A˜2ÑÔ€EØ�4˜%‘<Ñ €EØ€}å�U—^’^Ñ%Ô%×)Ò)Ñ+Ô+¨d¯mªm©o¬o×.AÒ.AÑ.CÔ.CÑCÑDÔDÐDõ •S˜¥5­¨X©¬Ñ#7Ô#7Ñ8Ô8Ñ9Ô9ˆØˆØð 	7ð 	7ˆAØ�a”ˆAØ—J’J˜q !Ñ$Ô$ t§y¢y°°A¡¤Ñ6ˆBˆq‰EˆEØˆ	ó    )Nr   )Ú__doc__Únetworkxr	   Ú__all__Ú_dispatchabler   © r"   r!   ú<module>r(      s`   ððð ð Ð Ð Ð à!Ð
"€ð €Ô˜XÐ&Ñ&Ô&ð:ð :ð :ñ 'Ô&ð:ð :ð :r"   