+
    �°³jZ  ã                   óÔ   € R t ^ RIt^RIHt . ROt]! R4      ]P                  R 4       4       t]! R4      ]P                  R 4       4       t]! R4      ]P                  R 4       4       t	R# )zDProvides functions for computing the efficiency of nodes and graphs.N)Únot_implemented_forÚdirectedc                ó€   €  ^\         P                  ! WV4      ,          pV#   \         P                   d    ^ p T# i ; i)aä  Returns the efficiency of a pair of nodes in a graph.

The *efficiency* of a pair of nodes is the multiplicative inverse of the
shortest path distance between the nodes [1]_. Returns 0 if no path
between nodes.

Parameters
----------
G : :class:`networkx.Graph`
    An undirected graph for which to compute the average local efficiency.
u, v : node
    Nodes in the graph ``G``.

Returns
-------
float
    Multiplicative inverse of the shortest path distance between the nodes.

Examples
--------
>>> G = nx.Graph([(0, 1), (0, 2), (0, 3), (1, 2), (1, 3)])
>>> nx.efficiency(G, 2, 3)  # this gives efficiency for node 2 and 3
0.5

Notes
-----
Edge weights are ignored when computing the shortest path distances.

See also
--------
local_efficiency
global_efficiency

References
----------
.. [1] Latora, Vito, and Massimo Marchiori.
       "Efficient behavior of small-world networks."
       *Physical Review Letters* 87.19 (2001): 198701.
       <https://doi.org/10.1103/PhysRevLett.87.198701>

)ÚnxÚshortest_path_lengthÚNetworkXNoPath)ÚGÚuÚvÚeffs   &&& Úh/home/luca/screen-checking/.venv/lib/python3.14/site-packages/networkx/algorithms/efficiency_measures.pyÚ
efficiencyr   
   sG   € ðXØ”"×)Ò)¨!°Ó2Õ2ˆð €Jøô ×Ñô Ø‰Ø€Jðús   ‚" ¢=¼=c                ó
  € \        V 4      pW^,
          ,          pV^ 8w  d`   \        P                  ! V 4      p^ pV F7  w  rVVP                  4        F  w  rxV^ 8”  g   K  V^V,          ,          pK   	  K9  	  WB,          pV# ^ pV# )a»  Returns the average global efficiency of the graph.

The *efficiency* of a pair of nodes in a graph is the multiplicative
inverse of the shortest path distance between the nodes. The *average
global efficiency* of a graph is the average efficiency of all pairs of
nodes [1]_.

Parameters
----------
G : :class:`networkx.Graph`
    An undirected graph for which to compute the average global efficiency.

Returns
-------
float
    The average global efficiency of the graph.

Examples
--------
>>> G = nx.Graph([(0, 1), (0, 2), (0, 3), (1, 2), (1, 3)])
>>> round(nx.global_efficiency(G), 12)
0.916666666667

Notes
-----
Edge weights are ignored when computing the shortest path distances.

See also
--------
local_efficiency

References
----------
.. [1] Latora, Vito, and Massimo Marchiori.
       "Efficient behavior of small-world networks."
       *Physical Review Letters* 87.19 (2001): 198701.
       <https://doi.org/10.1103/PhysRevLett.87.198701>

)Úlenr   Úall_pairs_shortest_path_lengthÚitems)	r   ÚnÚdenomÚlengthsÚg_effÚsourceÚtargetsÚtargetÚdistances	   &        r   Úglobal_efficiencyr   =   s‡   € ôT 	ˆA‹€AØ�Q•�K€EØ�„zÜ×3Ò3°AÓ6ˆØˆÛ&‰OˆFØ$+§M¡M¦OÑ �Ø˜a–<Ø˜Q �\Õ)’Eó %4ñ  'ð 	�ˆð €Lð ˆð €Ló    c                óR   a € V 3R lS  4       p\        V4      \        S 4      ,          # )a0  Returns the average local efficiency of the graph.

The *efficiency* of a pair of nodes in a graph is the multiplicative
inverse of the shortest path distance between the nodes. The *local
efficiency* of a node in the graph is the average global efficiency of the
subgraph induced by the neighbors of the node. The *average local
efficiency* is the average of the local efficiencies of each node [1]_.

Parameters
----------
G : :class:`networkx.Graph`
    An undirected graph for which to compute the average local efficiency.

Returns
-------
float
    The average local efficiency of the graph.

Examples
--------
>>> G = nx.Graph([(0, 1), (0, 2), (0, 3), (1, 2), (1, 3)])
>>> nx.local_efficiency(G)
0.9166666666666667

Notes
-----
Edge weights are ignored when computing the shortest path distances.

See also
--------
global_efficiency

References
----------
.. [1] Latora, Vito, and Massimo Marchiori.
       "Efficient behavior of small-world networks."
       *Physical Review Letters* 87.19 (2001): 198701.
       <https://doi.org/10.1103/PhysRevLett.87.198701>

c              3   óf   <"  € T F&  p\        SP                  SV,          4      4      x € K(  	  R # 5i)N)r   Úsubgraph)Ú.0r
   r   s   & €r   Ú	<genexpr>Ú#local_efficiency.<locals>.<genexpr>¥   s'   øé € ÐFÁA¸qÔ(¨¯©°A°aµDÓ)9×:Ð:ÃAùs   ƒ.1)Úsumr   )r   Úefficiency_lists   f r   Úlocal_efficiencyr$   z   s%   ø€ ôV GÁAÓF€OÜˆÓ¤# a£&Õ(Ð(r   )r   r$   r   )
Ú__doc__Únetworkxr   Úutilsr   Ú__all__Ú_dispatchabler   r   r$   © r   r   Ú<module>r+      sŠ   ðÙ Jã å 'â
A€ñ �ZÓ Ø×Ññ.ó ó !ð.ñb �ZÓ Ø×Ññ8ó ó !ð8ñv �ZÓ Ø×Ññ*)ó ó !ò*)r   