+
    �°³jÇ   ã                   ó   € R t ^ RIHt ^ RIHt ^ RIHt ^ RIt^ RI	H
t
 ^RIHt . ROt]P                  R 4       tR t]
! R	4      ]
! R
4      ]P                  R 4       4       4       t]
! R	4      ]
! R
4      ]P                  R 4       4       4       tR# )zI
=======================
Distance-regular graphs
=======================
)Údefaultdict)Úcombinations_with_replacement)ÚlogN)Únot_implemented_for)Údiameterc                óV   €  \        V 4       R#   \        P                   d     R# i ; i)a¥  Returns True if the graph is distance regular, False otherwise.

A connected graph G is distance-regular if for any nodes x,y
and any integers i,j=0,1,...,d (where d is the graph
diameter), the number of vertices at distance i from x and
distance j from y depends only on i,j and the graph distance
between x and y, independently of the choice of x and y.

Parameters
----------
G: Networkx graph (undirected)

Returns
-------
bool
  True if the graph is Distance Regular, False otherwise

Examples
--------
>>> G = nx.hypercube_graph(6)
>>> nx.is_distance_regular(G)
True

See Also
--------
intersection_array, global_parameters

Notes
-----
For undirected and simple graphs only

References
----------
.. [1] Brouwer, A. E.; Cohen, A. M.; and Neumaier, A.
    Distance-Regular Graphs. New York: Springer-Verlag, 1989.
.. [2] Weisstein, Eric W. "Distance-Regular Graph."
    http://mathworld.wolfram.com/Distance-RegularGraph.html

TF)Úintersection_arrayÚnxÚNetworkXError©ÚGs   &Úe/home/luca/screen-checking/.venv/lib/python3.14/site-packages/networkx/algorithms/distance_regular.pyÚis_distance_regularr      s+   € ðRÜ˜1ÔÙøÜ×Ñô Úðús   ‚ �(§(c                óP   a € V 3R l\        S ^ .,           ^ .V,           4       4       # )a  Returns global parameters for a given intersection array.

Given a distance-regular graph G with diameter d and integers b_i,
c_i,i = 0,....,d such that for any 2 vertices x,y in G at a distance
i=d(x,y), there are exactly c_i neighbors of y at a distance of i-1 from x
and b_i neighbors of y at a distance of i+1 from x.

Thus, a distance regular graph has the global parameters,
[[c_0,a_0,b_0],[c_1,a_1,b_1],......,[c_d,a_d,b_d]] for the
intersection array  [b_0,b_1,.....b_{d-1};c_1,c_2,.....c_d]
where a_i+b_i+c_i=k , k= degree of every vertex.

Parameters
----------
b : list

c : list

Returns
-------
iterable
   An iterable over three tuples.

Examples
--------
>>> G = nx.dodecahedral_graph()
>>> b, c = nx.intersection_array(G)
>>> list(nx.global_parameters(b, c))
[(0, 0, 3), (1, 0, 2), (1, 1, 1), (1, 1, 1), (2, 0, 1), (3, 0, 0)]

References
----------
.. [1] Weisstein, Eric W. "Global Parameters."
   From MathWorld--A Wolfram Web Resource.
   http://mathworld.wolfram.com/GlobalParameters.html

See Also
--------
intersection_array
c              3   ó\   <"  € T F!  w  rVS^ ,          V,
          V,
          V3x € K#  	  R# 5i)é    N© )Ú.0ÚxÚyÚbs   &  €r   Ú	<genexpr>Ú$global_parameters.<locals>.<genexpr>q   s(   øé € ÐCÑ-B¡T QˆQ��!•�q•˜1•˜aÕ Ó-Bùs   ƒ),)Úzip)r   Úcs   f&r   Úglobal_parametersr   H   s%   ø€ ôR D¬S°°a°Sµ¸1¸#À½'Ô-BÓCÐCó    ÚdirectedÚ
multigraphc                óì  aa€ \         P                  ! V 4      '       d   \         P                  ! V 4      '       g   \         P                  ! R4      h\	        \
        4      p/ p/ p^ p^\        \        V 4      ^4      ,          ^,          p\        V ^4       EFw  w  rgW,          oVS9  dJ   SP                  \         P                  ! W4      4       SP                  4        F  w  r‰W‘V,          V&   K  	  W,          V,          o\        VS4      pWE8”  d   \         P                  ! R4      hW,          p
V
 F\  pW,          pWl9  g   K  VP                  \         P                  ! W4      4       VP                  4        F  w  r‰W‘V,          V&   K  	  K^  	  \        VV3R lV
 4       4      p\        VV3R lV
 4       4      pVP                  SV4      V8w  g   VP                  SV4      V8w  d   \         P                  ! R4      hWâS&   WÓS&   EKz  	  \        V4       Uu. uF  qòP                  V^ 4      NK  	  up\        V4       Uu. uF  qóP                  V^,           ^ 4      NK  	  up3# u upi u upi )a(  Returns the intersection array of a distance-regular graph.

Given a distance-regular graph G with integers b_i, c_i,i = 0,....,d
such that for any 2 vertices x,y in G at a distance i=d(x,y), there
are exactly c_i neighbors of y at a distance of i-1 from x and b_i
neighbors of y at a distance of i+1 from x.

A distance regular graph's intersection array is given by,
[b_0,b_1,.....b_{d-1};c_1,c_2,.....c_d]

Parameters
----------
G: Networkx graph (undirected)

Returns
-------
b,c: tuple of lists

Examples
--------
>>> G = nx.icosahedral_graph()
>>> nx.intersection_array(G)
([5, 2, 1], [1, 2, 5])

References
----------
.. [1] Weisstein, Eric W. "Intersection Array."
   From MathWorld--A Wolfram Web Resource.
   http://mathworld.wolfram.com/IntersectionArray.html

See Also
--------
global_parameters
zGraph is not distance regular.c              3   óV   <"  € T F  pSV,          S^,
          8X  g   K  ^x € K   	  R# 5i©é   Nr   ©r   ÚnÚiÚpl_us   & €€r   r   Ú%intersection_array.<locals>.<genexpr>Ë   ó"   øé € Ð5™5�a D¨¥G¨q°1­uÑ$4—’›5ùó   ƒ)Ÿ
)c              3   óV   <"  € T F  pSV,          S^,           8X  g   K  ^x € K   	  R# 5ir!   r   r#   s   & €€r   r   r'   Í   r(   r)   zGraph is not distance regular)r	   Ú
is_regularÚis_connectedr
   r   Údictr   Úlenr   ÚupdateÚ"single_source_shortest_path_lengthÚitemsÚmaxÚsumÚgetÚrange)r   Úpath_lengthÚbintÚcintÚdiamÚmax_diameter_for_dr_graphsÚuÚvr   ÚdistanceÚvnbrsr$   Úpl_nr   r   Újr%   r&   s   &               @@r   r   r   t   sÿ  ù€ ôd �=Š=˜×Ò¤2§?¢?°1×#5Ò#5Ü×ÒÐ?Ó@Ð@äœdÓ#€KØ€DØ€Dð
 €DØ"#¤c¬#¨a«&°!£nÕ"4¸Õ!9ÐÜ-¨a°×3‰ˆà�~ˆØ�DŒ=Ø�K‰Kœ×=Ò=¸aÓCÔDØ#Ÿz™zž|‘�Ø$,˜A•˜qÓ!ñ  ,ð �N˜1ÕˆÜ�4˜‹|ˆð Ô,Ü×"Ò"Ð#CÓDÐDà•ˆãˆAØ•>ˆDØŽ}Ø—‘œB×AÒAÀ!ÓGÔHØ#'§:¡:¦<‘K�AØ(0 •N 1Ó%ó $0ñ	 ô Õ5™5Ó5Ó5ˆäÕ5™5Ó5Ó5ˆà�8‰8�A�q‹>˜QÔ $§(¡(¨1¨a£.°AÔ"5Ü×"Ò"Ð#BÓCÐCØˆQ‰ØˆQŒñA 4ôF "' t¤Ó-¡˜A�‰�!�QŽ¡Ñ-Ü%*¨4¤[Ó1¡[ �‰�!�a•%˜Ö	¡[Ñ1ðð ùÚ-ùÚ1s   ÈI,É!I1c                óD   € \        V 4      ;'       d    \        V 4      ^8H  # )a«  Returns True if and only if the given graph is strongly
regular.

An undirected graph is *strongly regular* if

* it is regular,
* each pair of adjacent vertices has the same number of neighbors in
  common,
* each pair of nonadjacent vertices has the same number of neighbors
  in common.

Each strongly regular graph is a distance-regular graph.
Conversely, if a distance-regular graph has diameter two, then it is
a strongly regular graph. For more information on distance-regular
graphs, see :func:`is_distance_regular`.

Parameters
----------
G : NetworkX graph
    An undirected graph.

Returns
-------
bool
    Whether `G` is strongly regular.

Examples
--------

The cycle graph on five vertices is strongly regular. It is
two-regular, each pair of adjacent vertices has no shared neighbors,
and each pair of nonadjacent vertices has one shared neighbor::

    >>> G = nx.cycle_graph(5)
    >>> nx.is_strongly_regular(G)
    True

)r   r   r   s   &r   Úis_strongly_regularrB   Û   s!   € ôj ˜qÓ!×6Ð6¤h¨q£k°QÑ&6Ð6r   )r   rB   r   r   )Ú__doc__Úcollectionsr   Ú	itertoolsr   Úmathr   Únetworkxr	   Únetworkx.utilsr   Údistance_measuresr   Ú__all__Ú_dispatchabler   r   r   rB   r   r   r   Ú<module>rL      s²   ðñõ $Ý 3Ý ã Ý .å 'ò€ð ×Ññ,ó ð,ò^)DñX �ZÓ Ù�\Ó"Ø×Ññ`ó ó #ó !ð`ñH �ZÓ Ù�\Ó"Ø×Ññ27ó ó #ó !ò27r   