+
    �°³j'  ã                   ó´   € R t ^ RIt^ RIHt ^RIHt RR.t]! RR4      ]P                  RR l4       4       tR	 t	]! RR4      ]P                  R
 4       4       t
R# )z8Algorithms to calculate reciprocity in a directed graph.N)ÚNetworkXError)Únot_implemented_forÚreciprocityÚoverall_reciprocityÚ
undirectedÚ
multigraphc                ó¬   € Vf   \        V 4      # W9   d-   \        \        W4      4      ^,          pVf   \        R4      hV# \	        \        W4      4      # )a  Compute the reciprocity in a directed graph.

The reciprocity of a directed graph is defined as the ratio
of the number of edges pointing in both directions to the total
number of edges in the graph.
Formally, $r = |{(u,v) \in G|(v,u) \in G}| / |{(u,v) \in G}|$.

The reciprocity of a single node u is defined similarly,
it is the ratio of the number of edges in both directions to
the total number of edges attached to node u.

Parameters
----------
G : graph
   A networkx directed graph
nodes : container of nodes, optional (default=whole graph)
   Compute reciprocity for nodes in this container.

Returns
-------
out : dictionary
   Reciprocity keyed by node label.

Notes
-----
The reciprocity is not defined for isolated nodes.
In such cases this function will return None.

zNot defined for isolated nodes.)r   ÚnextÚ_reciprocity_iterr   Údict)ÚGÚnodesr   s   && Ú`/home/luca/screen-checking/.venv/lib/python3.14/site-packages/networkx/algorithms/reciprocity.pyr   r      s\   € ðB ‚}Ü" 1Ó%Ð%ð „zÜÔ,¨QÓ6Ó7¸Õ:ˆØÒÜÐ AÓBÐBàÐô Ô! !Ó+Ó,Ð,ó    c              #  óJ  "  € V P                  V4      pV F‡  p\        V P                  V4      4      p\        V P                  V4      4      pWE,          p\	        V4      \	        V4      ,           pV^ 8X  d	   VR3x € Ki  ^\	        V4      ,          V,          pW83x € K‰  	  R# 5i)z*Return an iterator of (node, reciprocity).N)Únbunch_iterÚsetÚpredecessorsÚ
successorsÚlen)	r   r   ÚnÚnodeÚpredÚsuccÚoverlapÚn_totalr   s	   &&       r   r
   r
   =   s‹   é € à	�‰�eÓ€AÛˆÜ�1—>‘> $Ó'Ó(ˆÜ�1—<‘< Ó%Ó&ˆØ•+ˆÜ�d“)œc $›iÕ'ˆð �aŒ<Ø˜�,Ôàœc '›lÕ*¨WÕ4ˆKØÐ%Ô%ó ùs   ‚B!B#c                ó¬   € V P                  4       pWP                  4       P                  4       ,
          ^,          pV^ 8X  d   \        R4      hW!,          # )z“Compute the reciprocity for the whole graph.

See the doc of reciprocity for the definition.

Parameters
----------
G : graph
   A networkx graph

zNot defined for empty graphs)Únumber_of_edgesÚto_undirectedr   )r   Ú
n_all_edgeÚn_overlap_edges   &  r   r   r   O   sK   € ð ×"Ñ"Ó$€JØ §?¡?Ó#4×#DÑ#DÓ#FÕFÈ!ÕK€Nà�Q„ÜÐ:Ó;Ð;àÕ&Ð&r   )N)Ú__doc__ÚnetworkxÚnxr   Úutilsr   Ú__all__Ú_dispatchabler   r
   r   © r   r   Ú<module>r(      st   ðÙ >ã Ý "å 'àÐ/Ð
0€ñ �\ <Ó0Ø×Ñó--ó ó 1ð--ò`&ñ$ �\ <Ó0Ø×Ññ'ó ó 1ò'r   