ó
    …~in  ã                   óF   • S r SSKrS/r\R                  " SS9SS j5       rg)z
Spectral bipartivity measure.
é    NÚspectral_bipartivityÚweight)Ú
edge_attrsc           
      ó  • SSK n[        U 5      n[        R                  " XUS9nUR                  R                  U5      nUR                  R                  U* 5      nSXg-   -  nUcF  [        UR                  5       R                  5       UR                  5       R                  5       -  5      $ [        [        U[        [        U5      5      5      5      n	0 n
U H,  nX›   nUR                  XÌ5      UR                  XÌ5      -  X«'   M.     U
$ )u½  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                Úc/home/mande/repo/quber/.venv/lib/python3.13/site-packages/networkx/algorithms/bipartite/spectral.pyr   r   
   sß   € óT ä�A‹w€HÜ
×Ò˜!¨fÑ5€AØ�9‰9�>‰>˜!Ó€DØ�I‰I�N‰N˜A˜2Ó€EØ�4‘<Ñ €EØ�}ä�U—^‘^Ó%×)Ñ)Ó+¨d¯m©m«o×.AÑ.AÓ.CÑCÓDÐDô ”S˜¤5¬¨X«Ó#7Ó8Ó9ˆØˆÛˆAØ‘ˆAØ—J‘J˜qÓ$ t§y¡y°£Ñ6ˆB‹Eñ ð ˆ	ó    )Nr   )Ú__doc__Únetworkxr	   Ú__all__Ú_dispatchabler   © r"   r!   Ú<module>r(      s6   ðñó à!Ð
"€ð ×Ò˜XÑ&ó:ó 'ñ:r"   