+
    �°³j  ã                   óÆ   € R t ^ RIt^ RIHt RR.t]! R4      ]! R4      ]P                  R 4       4       4       t]! R4      ]! R4      ]P                  R 4       4       4       tR# )	z
Communicability.
N)Únot_implemented_forÚcommunicabilityÚcommunicability_expÚdirectedÚ
multigraphc                ó�  € ^ RI p\        P                  ! V RR7      pVP                  P	                  V4      w  r4WAP                  V4      ,          VP                  ,          p\        V 4       UUUU	u/ uF<  w  rgT\        V 4       UU	u/ uF  w  r‰V	\        WV,          V,          4      bK   	  up	pbK>  	  up	ppp# u up	pi u up	pppi )a÷  Returns communicability between all pairs of nodes in `G`.

The communicability between pairs of nodes in `G` is the sum of
walks of different lengths starting at node ``u`` and ending at node ``v``.

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

Returns
-------
comm : dictionary of dictionaries
    Dictionary of dictionaries keyed by nodes with communicability
    as the value.

Raises
------
NetworkXError
   If the graph is not undirected and simple.

See Also
--------
communicability_exp:
   Communicability between all pairs of nodes in `G` using matrix exponentiation
communicability_betweenness_centrality:
   Communicability betweenness centrality for each node in `G`.

Notes
-----
This algorithm uses a spectral decomposition of the adjacency matrix.
Let $G=(V,E)$ be a simple undirected graph.  Using the connection between
the powers of the adjacency matrix and the number of walks in the graph,
the communicability between nodes ``u`` and ``v`` based on the graph spectrum
is:

.. math::
    C(u,v)=\sum_{j=1}^{n}\phi_{j}(u)\phi_{j}(v)e^{\lambda_{j}}

where $\phi_{j}(u)$ is the $u\rm{th}$ element of the $j\rm{th}$ orthonormal
eigenvector of the adjacency matrix associated with the eigenvalue
$\lambda_{j}$ [1]_.

References
----------
.. [1] Ernesto Estrada, Naomichi Hatano,
   "Communicability in complex networks",
   Phys. Rev. E 77, 036111 (2008).
   https://arxiv.org/abs/0707.0756

Examples
--------
>>> G = nx.Graph([(0, 1), (1, 2), (1, 5), (5, 4), (2, 4), (2, 3), (4, 3), (3, 6)])
>>> c = nx.communicability(G)
N)Úweight)	ÚnumpyÚnxÚto_numpy_arrayÚlinalgÚeighÚexpÚTÚ	enumerateÚfloat)
ÚGÚnpÚAÚwÚvecr   ÚiÚuÚjÚvs
   &         Úh/home/luca/screen-checking/.venv/lib/python3.14/site-packages/networkx/algorithms/communicability_alg.pyr   r      s¢   € ót ä
×Ò˜! DÔ)€AØ�Y‰Y�^‰^˜AÓ�F€AØŸV™V A›Y•¨#¯%©%Õ/€Oô
 ˜a”Löá ‰DˆAð 	
¼	À!¼ÔE¹±°ˆAŒu�_Õ'¨Õ*Ó+Ò+¹ÒEÒEÙ ôð ùÛEùõs   Á2C 
Â$B:Â,C 
Â:C 
c           
     ód  € ^ RI p\        V 4      p\        P                  ! W4      p^W3R8g  &   VP                  P                  V4      p\        \        V\        \        V4      4      4      4      p/ pV  F9  p/ Wg&   V  F,  p\        WEV,          WX,          3,          4      Wg,          V&   K.  	  K;  	  V# )aH  Returns communicability between all pairs of nodes in `G`.

Communicability between pair of node ``(u, v)`` of node in `G` is the sum of
walks of different lengths starting at node ``u`` and ending at node ``v``.

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

Returns
-------
comm : dictionary of dictionaries
    Dictionary of dictionaries keyed by nodes with communicability
    as the value.

Raises
------
NetworkXError
    If the graph is not undirected and simple.

See Also
--------
communicability:
   Communicability between pairs of nodes in `G` via spectral decomposition
communicability_betweenness_centrality:
   Communicability betweenness centrality for each node in G.

Notes
-----
This algorithm uses matrix exponentiation of the adjacency matrix.

Let $G=(V,E)$ be a simple undirected graph. Using the connection between
the powers  of the adjacency matrix and the number of walks in the graph,
the communicability between nodes ``u`` and ``v`` is:

.. math::
    C(u,v) = (e^A)_{uv},

where ``A`` is the adjacency matrix of `G` [1]_.

References
----------
.. [1] Ernesto Estrada, Naomichi Hatano,
   "Communicability in complex networks",
   Phys. Rev. E 77, 036111 (2008).
   https://arxiv.org/abs/0707.0756

Examples
--------
>>> G = nx.Graph([(0, 1), (1, 2), (1, 5), (5, 4), (2, 4), (2, 3), (4, 3), (3, 6)])
>>> c = nx.communicability_exp(G)
Ng        )ÚscipyÚlistr
   r   r   ÚexpmÚdictÚzipÚrangeÚlenr   )	r   ÚspÚnodelistr   ÚexpAÚmappingÚcr   r   s	   &        r   r   r   R   s�   € óp ä�A‹w€HÜ
×Ò˜!Ó&€Aà€Aˆ3�h�Kà�9‰9�>‰>˜!Ó€DÜ”3�x¤¤s¨8£}Ó!5Ó6Ó7€GØ
€AÛˆØˆ‰ÛˆAÜ˜D¨¥¨W­ZÐ!7Õ8Ó9ˆA�D�‹Gó ñ ð €Hó    )	Ú__doc__Únetworkxr
   Únetworkx.utilsr   Ú__all__Ú_dispatchabler   r   © r)   r   Ú<module>r0      sŠ   ðñó Ý .àÐ3Ð
4€ñ �ZÓ Ù�\Ó"Ø×ÑñAó ó #ó !ðAñH �ZÓ Ù�\Ó"Ø×ÑñCó ó #ó !òCr)   