
    Vhc                        d dl Z d dlZd dlmZ e j                  j                  dej                  ej                  ej                  f      e j                  j                  dej                  ej                  f      d               Z
 G d d      Ze j                  j                  dej                  ej                  f      d        Z G d	 d
      Zy)    N)is_strongly_regularfgraph_constructorc                      |ddg      }t        j                  t        j                        5   | |       d d d        y # 1 sw Y   y xY w)N)r      )r      )pytestraisesnxNetworkXNotImplemented)r   r   Gs      _/home/dcms/DCMS/lib/python3.12/site-packages/networkx/algorithms/tests/test_distance_regular.py'test_raises_on_directed_and_multigraphsr      sA    
 	66*+A	r00	1 	!  s   	A  A	c                   $    e Zd Zd Zd Zd Zd Zy)TestDistanceRegularc                 @   t        j                  t        j                               sJ t        j                  t        j                               sJ t        j                  t        j                               sJ t        j                  t        j
                  dd            sJ t        j                  t        j                               sJ t        j                  t        j                               sJ t        j                  t        j                               sJ t        j                  t        j                               sJ t        j                  t        j                  d            sJ t        j                  t        j                  d            rJ y )N      )r   is_distance_regularicosahedral_graphpetersen_graphcubical_graphcomplete_bipartite_graphtetrahedral_graphdodecahedral_graphpappus_graphheawood_graphcycle_graph
path_graph)selfs    r   test_is_distance_regularz,TestDistanceRegular.test_is_distance_regular   s)   %%b&:&:&<===%%b&7&7&9:::%%b&6&6&8999%%b&A&A!Q&GHHH%%b&:&:&<===%%b&;&;&=>>>%%boo&7888%%b&6&6&8999%%bnnQ&7888))"--*:;;;;    c                     t        j                  d      }t        j                  |g d       t        j                  |      rJ y )Nr   )         )r   r   	add_cycler   r    r   s     r   test_not_connectedz&TestDistanceRegular.test_not_connected   s5    NN1
Q	"))!,,,,r"   c                 P   t        j                  t        j                  d            \  }}t        j                  ||      }t	        |      g dk(  sJ t        j                  t        j                  d            \  }}t        j                  ||      }t	        |      ddgk(  sJ y )Nr$   )r   r   r   )r   r   r   r   r   r   r   r+   r,   )r   intersection_arrayr   global_parameterslist)r    bcgs       r   test_global_parametersz*TestDistanceRegular.test_global_parameters$   s    $$R^^A%671  A&Aw;;;;$$R^^A%671  A&Aw9i0000r"   c                 n   t        j                  t        j                  d            \  }}|ddgk(  sJ |ddgk(  sJ t        j                  t        j                               \  }}|g dk(  sJ |g dk(  sJ t        j                  t        j                               \  }}|g dk(  sJ |g dk(  sJ y )Nr$   r   r   )r   r   r   r   r   )r   r   r   r   r   )r$   r   r   )r   r   r$   )r   r-   r   r   r   )r    r0   r1   s      r   test_intersection_arrayz+TestDistanceRegular.test_intersection_array,   s    $$R^^A%671QF{{QF{{$$R%:%:%<=1O###O###$$R%9%9%;<1I~~I~~r"   N)__name__
__module____qualname__r!   r)   r3   r5    r"   r   r   r      s    <-
1	r"   r   c                     t        j                         }t        j                  t         j                  d      5   | |       d d d        y # 1 sw Y   y xY w)NzGraph has no nodes)match)r   Graphr	   r
   NetworkXPointlessConcept)r   r   s     r   test_empty_graph_raisesr>   8   s>    

A	r22:N	O 	!  s   	AAc                   "    e Zd ZdZd Zd Zd Zy)TestStronglyRegularzLUnit tests for the :func:`~networkx.is_strongly_regular`
    function.

    c                 H    t        j                  d      }t        |      sJ y)zRTests that the cycle graph on five vertices is strongly
        regular.

        r$   N)r   r   r   r(   s     r   test_cycle_graphz$TestStronglyRegular.test_cycle_graphE   s     
 NN1"1%%%r"   c                 F    t        j                         }t        |      sJ y)z2Tests that the Petersen graph is strongly regular.N)r   r   r   r(   s     r   test_petersen_graphz'TestStronglyRegular.test_petersen_graphM   s    "1%%%r"   c                 H    t        j                  d      }t        |      rJ y)z2Tests that the path graph is not strongly regular.r   N)r   r   r   r(   s     r   test_path_graphz#TestStronglyRegular.test_path_graphR   s!    MM!&q))))r"   N)r6   r7   r8   __doc__rB   rD   rF   r9   r"   r   r@   r@   ?   s    
&&
*r"   r@   )r	   networkxr   r   markparametrizer   r-   DiGraph
MultiGraphr   r   r>   r@   r9   r"   r   <module>rM      s      ( "
 
 ""7"79O9O	P ,rzz2==.IJ K$ $N r55r7M7MNO P* *r"   