+
    )i/                     H    ^ RI Ht ^ RItR.t]P
                  RR l4       tR# )    )combinationsN
dispersionc                  aaaa VVVV3R lpVf{   Vf>   V  Uu/ uF  q/ bK  	  p	pV  F$  pW,           F  pV! WV4      W,          V&   K  	  K&  	  V	# \         P                  W,          / 4      p	W,           F  pV! WV4      W&   K  	   V	# Vf9   \         P                  W,          / 4      p	W,           F  pV! WV4      W&   K  	  V	# V! WV4      p	V	# u upi )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                  < \        W,          4      pW,           Uu0 uF  qDV9   g   K  VkK  	  ppW0p\        V^4      p^ pV FS  w  rVP                  W	,          4      V,
          pW9  g   K+  VP                  W
,          4      '       g   KJ  V^,          pKU  	  \	        V4      pTpS'       d.   VS,           S,          pVS,           ^ 8w  d   WS,           ,          pV# u upi )z=dispersion for all nodes 'v' in a ego network G_u of node 'u')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   &&&           g/var/www/html/photoedit/myenv/lib/python3.14/site-packages/networkx/algorithms/centrality/dispersion.py_dispersiondispersion.<locals>._dispersion9   s    SV/A;aa/b!$DA((069F$$SV,,QJE  2w#aiE1Na1$"22/ 0s
   C C )dictfromkeys)
Gr   r   r   r   r   r   r   r   resultss
   &&&ffff   r   r   r      s    b 8 	y9&'(a"uaG(A$/a$8GJqM  $ N mmAD"-GTT(q1
  N 9mmAD"-GTT(q1
  N "!*GN' )s   C)NNTg      ?        r$   )	itertoolsr   networkxnx__all___dispatchabler        r   <module>r,      s.    " . b br+   