+
    )i                         R t ^ RIt^ RIH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)NetworkXNoPath)not_implemented_fordirectedc                l     ^\         P                  ! WV4      ,          pV#   \         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_lengthr   )Guveffs   &&& e/var/www/html/photoedit/myenv/lib/python3.14/site-packages/networkx/algorithms/efficiency_measures.py
efficiencyr      sA    X"))!22 J  Js   " 33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KEz33A6&OF$+MMO 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'     FAq(AaD)9::As   .1)sumr   )r   efficiency_lists   f r   local_efficiencyr$   {   s%    V GAFO#a&((r   )r   r$   r   )__doc__networkxr   networkx.exceptionr   utilsr   __all___dispatchabler   r   r$    r   r   <module>r,      s    J  - '
A Z .  !.b Z 8  !8v Z *)  !*)r   