+
    )i                     r    ^ RI t ^ RIt] P                  ! R4      t] P                  ! R4        ! R R4      tR# )    Nnumpyscipyc                   B   a  ] tR t^	t o ]R 4       tR tR tR tRt	V t
R# )TestModularityc                    . ROp\         P                  ! V4      V n        \         P                  ! 4       V n        V P                  P                  R4       R# )   N)r      r	      r   )
)r
   r	   )r
   r   )r   r
   )r   r	   )r      )   r   )r      )r   r   )r   r   )r   r   )nxhavel_hakimi_graphGDiGraphDGadd_edges_from)clsdegs   & c/var/www/html/photoedit/myenv/lib/python3.14/site-packages/networkx/linalg/tests/test_modularity.pysetup_classTestModularity.setup_class
   s?    %%c* 	
    c                   \         P                  . RO. RO. RO. RO. RO.4      p. ROp\         P                  P                  \        P
                  ! V P                  4      V4       \         P                  P                  \        P
                  ! V P                  VR7      V\         P                  W"4      ,          4       R# )	zModularity matrixnodelistNg            ?r         ?        r               ?      пr    r   r#   r"   r$   r    r   r$   r$   g      r    r    r    r    r    r    )r   r   r
   r	   r   )nparraytestingassert_equalr   modularity_matrixr   ix_)selfBpermutations   &  r   test_modularityTestModularity.test_modularity    s     HH9448.	0 1 &


 4 4TVV <a@


  +>bff[./	
r   c                   \         P                  . RO. RO. RO. RO. R	O.4      pV P                  P                  4       pVP	                  4        F  w  r4RVP                  W43,          R&   K  	  \         P
                  P                  \        P                  ! V4      V4       \         P
                  P                  \        P                  ! VRR7      RV,          4       R# )
zModularity matrix with weightsr#   weight)r4   Nr   r!   r%   r&   r'   )	r(   r)   r   copyedgesr*   r+   r   r,   )r.   r/   
G_weightedn1n2s   &    r   test_modularity_weight%TestModularity.test_modularity_weight1   s     HH9448.	0 1 VV[[]
 &&(FB14JRV$X. ) 	

 4 4Z @!D


  H=sQw	
r   c           	        \         P                  . RO. RO. RO. RO. RO. RO.4      p. R	Op. R
Op\        P                  ! V P                  \        V P                  4      R7      p\         P                  P                  WA4       \         P                  P                  \        P                  ! V P                  VR7      V\         P                  W34      ,          4       R# )zDirected Modularity matrixr   N)皙ɿ333333?皙?皙ٿr@   r@   )r    r    r    r    r    r    )gffffff?皙?g333333ӿ333333rA   rB   )r=   r@   r=   r@   r>   r>   )r=   r@   r=   r>   r@   r>   )皙r=   rC   r?   r=   r=   )r   r
   r	   r   r   r   )r   r   r
   r	   r   r   )	r(   r)   r   directed_modularity_matrixr   sortedr*   r+   r-   )r.   r/   node_permutationidx_permutationmms   &    r   test_directed_modularity'TestModularity.test_directed_modularityE   s     HH:39:::< = .,**477VDGG_M


&


))$''<LMbff_67	
r    N)__name__
__module____qualname____firstlineno__classmethodr   r1   r:   rI   __static_attributes____classdictcell__)__classdict__s   @r   r   r   	   s+     
 
*
"
(
 
r   r   )pytestnetworkxr   importorskipr(   r   rK   r   r   <module>rW      s5     !   G M
 M
r   