ó
    …~i/  ã                   óF   • S SK Jr  S SKrS/r\R
                  SS j5       rg)é    )ÚcombinationsNÚ
dispersionc                 ó|  ^^^^• UUUU4S jnUcj  Uc6  U  Vs0 s H  oˆ0 _M     n	nU  H  nX    H  nU" XU5      X‘   U'   M     M     U	$ [         R                  X   0 5      n	X    H  nU" XU5      X‘'   M      U	$ Uc0  [         R                  X   0 5      n	X    H  nU" XU5      X’'   M     U	$ U" XU5      n	U	$ s  snf )a	  Calculate dispersion between `u` and `v` in `G`.

A link between two actors (`u` and `v`) has a high dispersion when their
mutual ties (`s` and `t`) are not well connected with each other.

Parameters
----------
G : graph
    A NetworkX graph.
u : node, optional
    The source for the dispersion score (e.g. ego node of the network).
v : node, optional
    The target of the dispersion score if specified.
normalized : bool
    If True (default) normalize by the embeddedness of the nodes (u and v).
alpha, b, c : float
    Parameters for the normalization procedure. When `normalized` is True,
    the dispersion value is normalized by::

        result = ((dispersion + b) ** alpha) / (embeddedness + c)

    as long as the denominator is nonzero.

Returns
-------
nodes : dictionary
    If u (v) is specified, returns a dictionary of nodes with dispersion
    score for all "target" ("source") nodes. If neither u nor v is
    specified, returns a dictionary of dictionaries for all nodes 'u' in the
    graph with a dispersion score for each node 'v'.

Notes
-----
This implementation follows Lars Backstrom and Jon Kleinberg [1]_. Typical
usage would be to run dispersion on the ego network $G_u$ if $u$ were
specified.  Running :func:`dispersion` with neither $u$ nor $v$ specified
can take some time to complete.

References
----------
.. [1] Romantic Partnerships and the Dispersion of Social Ties:
    A Network Analysis of Relationship Status on Facebook.
    Lars Backstrom, Jon Kleinberg.
    https://arxiv.org/pdf/1310.6753v1.pdf

c                 ój  >• [        X   5      nX    Vs1 s H  oDU;   d  M
  UiM     nnX1n[        US5      nSnU HA  u  pšUR                  X	   5      U-
  nX«;  d  M"  UR                  X
   5      (       d  M<  US-  nMC     [	        U5      nUnT(       a  UT-   T-  nUT-   S:w  a  XÜT-   -  nU$ s  snf )z=dispersion for all nodes 'v' in a ego network G_u of node 'u'é   r   é   )Úsetr   ÚintersectionÚ
isdisjointÚlen)ÚG_uÚuÚvÚu_nbrsÚnÚSTÚset_uvÚpossibÚtotalÚsÚtÚnbrs_sÚembeddednessÚdispersion_valÚalphaÚbÚcÚ
normalizeds                 €€€€Úf/home/mande/repo/quber/.venv/lib/python3.13/site-packages/networkx/algorithms/centrality/dispersion.pyÚ_dispersionÚdispersion.<locals>._dispersion9   sÊ   ø€ ä�S‘V“ˆØšÓ/š�A¨¡;�a™ˆÐ/Ø�ˆä˜b !Ó$ˆØˆÛ‰DˆAà×(Ñ(¨©Ó0°6Ñ9ˆFà�à×$Ñ$ S¡V×,Ó,à˜Q‘J’Eñ ô ˜2“wˆàˆÞØ# a™i¨EÑ1ˆNØ˜aÑ 1Ó$Ø°Ñ"2Ñ2�àÐùò/ 0s
   •	B0¢B0)ÚdictÚfromkeys)
ÚGr   r   r   r   r   r   r    r   Úresultss
      ````   r   r   r      sæ   û€ ÷bð ð8 	�yà‰9Ù&'Ó(¢a ˜"’u¡aˆGÐ(Û�Øœ�AÙ$/°°aÓ$8�G‘J˜q“Mó ñ ð$ €Nô —m‘m A¡D¨"Ó-ˆGØ”T�Ù(¨¨qÓ1�“
ò ð €Nð ‰9Ü—m‘m A¡D¨"Ó-ˆGØ”T�Ù(¨¨qÓ1�“
ñ ð €Nñ " !¨Ó*ˆGà€Nùò' )s   ˜B9)NNTg      ð?ç        r&   )Ú	itertoolsr   ÚnetworkxÚnxÚ__all__Ú_dispatchabler   © ó    r   Ú<module>r.      s.   ðÝ "ã àˆ.€ð ×Ñóbó ñbr-   