
    ިsgF                         d dl Z d dlZd dlmZ d dlZd dlZd Z G d d      Z G d d      Z	d Z
 G d	 d
      Z G d d      Z G d d      Z G d d      Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zy)    N)combinationsc                 :    t        d t        | |      D              S )Nc              3   >   K   | ]  \  }}t        ||z
          y wNabs.0abs      [/var/www/html/venv/lib/python3.12/site-packages/networkx/generators/tests/test_geometric.py	<genexpr>zl1dist.<locals>.<genexpr>   s     0das1q5z0   sumzipxys     r   l1distr   
   s    0c!Qi000    c                   .    e Zd ZdZd Zd Zd Zd Zd Zy)TestRandomGeometricGraphz7Unit tests for :func:`~networkx.random_geometric_graph`c                     t        j                  ddd      }t        |      dk(  sJ t        j                  t        d      dd      }t        |      dk(  sJ y N2         ?*   seed)nxrandom_geometric_graphlenrangeselfGs     r   test_number_of_nodesz-TestRandomGeometricGraph.test_number_of_nodes   sN    %%b$R81v||%%eBiB?1v||r   c                 T   t        j                  dd      }t        |d      D ]  \  }}|||   v r<t        j                  |j
                  |   d   |j
                  |   d         dk  rGJ t        j                  |j
                  |   d   |j
                  |   d         dk  sJ  ylTests that pairs of vertices adjacent if and only if they are
        within the prescribed radius.
        r   r      posN)r!   r"   r   mathdistnodesr&   r'   uvs       r   test_distancesz'TestRandomGeometricGraph.test_distances   s     %%b$/ A& 	SDAqAaDyyyE!2AGGAJu4EF$NNN  99QWWQZ%6
58IJdRRR	Sr   c                 0   t        j                  ddd      }t        |d      D ]o  \  }}|||   v r2t        |j                  |   d   |j                  |   d         dk  r=J t        |j                  |   d   |j                  |   d         dk  soJ  y)BTests for providing an alternate distance metric to the generator.r   r      pr,   r-   N)r!   r"   r   r   r0   r1   s       r   test_pzTestRandomGeometricGraph.test_p&   s     %%b$!4 A& 	PDAqAaDyaggaj/E1BCtKKK "!''!*U"3QWWQZ5FG4OOO	Pr   c                    ddl }t        |j                        }t        j                  |d      }t        |      t        |      k(  sJ t        |d      D ]  \  }}|||   v r<t        j                  |j                  |   d   |j                  |   d         dk  rGJ t        j                  |j                  |   d   |j                  |   d         dk  sJ  y=Tests using values other than sequential numbers as node IDs.r   Nr   r,   r-   )
stringlistascii_lowercaser!   r"   r#   r   r.   r/   r0   r&   r>   r0   r'   r2   r3   s         r   test_node_namesz(TestRandomGeometricGraph.test_node_names2   s    V++,%%eT21vU### A& 	SDAqAaDyyyE!2AGGAJu4EF$NNN  99QWWQZ%6
58IJdRRR	Sr   c                     t        j                  dddd      }t        d |j                  j	                         D              sJ y )Nr   r   r   coordsr    pos_namec              3   D   K   | ]  \  }}t        |d          dk(    ywrD   r,   Nr#   r
   nds      r   r   z9TestRandomGeometricGraph.test_pos_name.<locals>.<genexpr>D   "     ETQ3q{#q(E    )r!   r"   allr0   itemsr%   s     r   test_pos_namez&TestRandomGeometricGraph.test_pos_nameB   s6    %%b$R(KEQWW]]_EEEEr   N)	__name__
__module____qualname____doc__r(   r4   r:   rB   rQ    r   r   r   r      s"    AS
PS Fr   r   c                   :    e Zd ZdZd Zd Zd Zd Zd Zd Z	d Z
y	)
TestSoftRandomGeometricGraphz<Unit tests for :func:`~networkx.soft_random_geometric_graph`c                     t        j                  ddd      }t        |      dk(  sJ t        j                  t        d      dd      }t        |      dk(  sJ y r   )r!   soft_random_geometric_graphr#   r$   r%   s     r   r(   z1TestSoftRandomGeometricGraph.test_number_of_nodesJ   sN    **2t"=1v||**59dD1v||r   c                     t        j                  dd      }t        |d      D ]H  \  }}|||   v st        j                  |j
                  |   d   |j
                  |   d         dk  rHJ  yr*   )r!   rZ   r   r.   r/   r0   r1   s       r   r4   z+TestSoftRandomGeometricGraph.test_distancesP   sp     **2t4 A& 	ODAqAaDyyyE!2AGGAJu4EF$NNN	Or   c                     d }t        j                  ddd      }t        |d      D ];  \  }}|||   v s ||j                  |   d   |j                  |   d         dk  r;J  y)	r6   c                 :    t        d t        | |      D              S )Nc              3   >   K   | ]  \  }}t        ||z
          y wr   r   r	   s      r   r   zDTestSoftRandomGeometricGraph.test_p.<locals>.dist.<locals>.<genexpr>a        8das1q5z8r   r   r   s     r   r/   z1TestSoftRandomGeometricGraph.test_p.<locals>.dist`       8c!Qi888r   r   r   r7   r8   r,   r-   N)r!   rZ   r   r0   r&   r/   r'   r2   r3   s        r   r:   z#TestSoftRandomGeometricGraph.test_p\   ss    	9 **2tq9 A& 	JDAqAaDyAGGAJu-qwwqz%/@ATIII	Jr   c                 B   ddl }t        |j                        }t        j                  |d      }t        |      t        |      k(  sJ t        |d      D ]H  \  }}|||   v st        j                  |j                  |   d   |j                  |   d         dk  rHJ  yr<   )
r>   r?   r@   r!   rZ   r#   r   r.   r/   r0   rA   s         r   rB   z,TestSoftRandomGeometricGraph.test_node_namesi   s    V++,**5$71vU### A& 	ODAqAaDyyyE!2AGGAJu4EF$NNN	Or   c           
      t   d}d}t        |      D ci c].  }|t        |      D cg c]  }t        j                          c}0 }}}t        j                  dd|      }t        j                  dd|      }t        |j                               t        |j                               k  sJ yc c}w c c}}w )zwTests default p_dict = 0.5 returns graph with edge count <= RGG with
        same n, radius, dim and positions
        r   r,   r   )r-   N)r$   randomr!   r"   rZ   r#   edges)r&   r0   dimr3   ir-   RGGSRGGs           r   test_p_dist_defaultz0TestSoftRandomGeometricGraph.test_p_dist_defaultv   s     AFuNAqE#J7q6==?77NN''Dc:--b$C@4::< C		$4444 8Ns   B4B/B4/B4c                 n    d }t        j                  dd|      }t        |j                        dk(  sJ y);Tests if p_dict = 0 returns disconnected graph with 0 edgesc                      yNr   rV   r/   s    r   p_distz=TestSoftRandomGeometricGraph.test_p_dist_zero.<locals>.p_dist       r   r   r   rp   r   N)r!   rZ   r#   re   r&   rp   r'   s      r   test_p_dist_zeroz-TestSoftRandomGeometricGraph.test_p_dist_zero   s3    	 **2tFC177|q   r   c                     t        j                  dddd      }t        d |j                  j	                         D              sJ y )Nr   r   r   rD   rE   c              3   D   K   | ]  \  }}t        |d          dk(    ywrH   rI   rJ   s      r   r   z=TestSoftRandomGeometricGraph.test_pos_name.<locals>.<genexpr>   rM   rN   )r!   rZ   rO   r0   rP   r%   s     r   rQ   z*TestSoftRandomGeometricGraph.test_pos_name   s6    **2t"xPEQWW]]_EEEEr   N)rR   rS   rT   rU   r(   r4   r:   rB   rj   rt   rQ   rV   r   r   rX   rX   G   s,    F
OJO	5!Fr   rX   c                     | j                   |   | j                   |   }}|d   |d   }	}|d   |d   }}
|
|z    |||	      |z  z  |k\  S )a~  Returns ``True`` if and only if the nodes whose attributes are
    ``du`` and ``dv`` should be joined, according to the threshold
    condition for geographical threshold graphs.

    ``G`` is an undirected NetworkX graph, and ``u`` and ``v`` are nodes
    in that graph. The nodes must have node attributes ``'pos'`` and
    ``'weight'``.

    ``metric`` is a distance metric.
    r-   weight)r0   )r'   r2   r3   thetaalphametricdudvu_posv_posu_weightv_weights               r   joinr      s`     WWQZBe9bi5EHr(|hHx6%#75#@@EIIr   c                   .    e Zd ZdZd Zd Zd Zd Zd Zy)TestGeographicalThresholdGraphz=Unit tests for :func:`~networkx.geographical_threshold_graph`c                     t        j                  ddd      }t        |      dk(  sJ t        j                  t        d      dd      }t        |      dk(  sJ y )Nr   d   r   r   )r!   geographical_threshold_graphr#   r$   r%   s     r   r(   z3TestGeographicalThresholdGraph.test_number_of_nodes   sN    ++B"=1v||++E"IsD1v||r   c           	          t        j                  dd      }t        |d      D ]M  \  }}|||   v r!t        |||ddt        j
                        r,J t        |||ddt        j
                        sMJ  y)zoTests that pairs of vertices adjacent if and only if their
        distances meet the given threshold.
        r   
   r,   N)r!   r   r   r   r.   r/   r1   s       r   r4   z-TestGeographicalThresholdGraph.test_distances   su     ++B3 A& 	<DAqAaDyAq!RTYY777  1aR;;;	<r   c           	          t        j                  ddt              }t        |d      D ]9  \  }}|||   v rt	        |||ddt              r"J t	        |||ddt              s9J  y)r6   r   r   r{   r,   r   N)r!   r   r   r   r   r1   s       r   test_metricz*TestGeographicalThresholdGraph.test_metric   so     ++B6B A& 	9DAqAaDyAq!RV444  1aR888	9r   c                 n    d }t        j                  dd|      }t        |j                        dk(  sJ y)rl   c                      yrn   rV   ro   s    r   rp   z?TestGeographicalThresholdGraph.test_p_dist_zero.<locals>.p_dist   rq   r   r   r7   rr   r   N)r!   r   r#   re   rs   s      r   rt   z/TestGeographicalThresholdGraph.test_p_dist_zero   s3    	 ++B&A177|q   r   c                     t         j                  } |ddddd      }t        d |j                  j	                         D              sJ t        d |j                  j	                         D              sJ y )	Nr   r   r   rD   wtr    rF   weight_namec              3   D   K   | ]  \  }}t        |d          dk(    ywrH   rI   rJ   s      r   r   zFTestGeographicalThresholdGraph.test_pos_weight_name.<locals>.<genexpr>   rM   rN   c              3   2   K   | ]  \  }}|d    dkD    ywr   r   NrV   rJ   s      r   r   zFTestGeographicalThresholdGraph.test_pos_weight_name.<locals>.<genexpr>        ;41a1T7Q;;   )r!   r   rO   r0   rP   )r&   gtgr'   s      r   test_pos_weight_namez3TestGeographicalThresholdGraph.test_pos_weight_name   s[    --Cb8FEQWW]]_EEEE;177==?;;;;r   N)	rR   rS   rT   rU   r(   r4   r   rt   r   rV   r   r   r   r      s    G<
9!<r   r   c                   (    e Zd ZdZd Zd Zd Zd Zy)TestWaxmanGraphz;Unit tests for the :func:`~networkx.waxman_graph` function.c                     t        j                  dddd      }t        |      dk(  sJ t        j                  t        d      ddd      }t        |      dk(  sJ y )Nr         ?皙?r   r   r!   waxman_graphr#   r$   r%   s     r   test_number_of_nodes_1z&TestWaxmanGraph.test_number_of_nodes_1   sN    OOBSr21v||OOE"IsCb91v||r   c                     t        j                  dddd      }t        |      dk(  sJ t        j                  t        d      ddd      }t        |      dk(  sJ y )Nr   r   r   r7   )Lr   r%   s     r   test_number_of_nodes_2z&TestWaxmanGraph.test_number_of_nodes_2   sN    OOBSA.1v||OOE"IsC151v||r   c                 ^    t        j                  dddt              }t        |      dk(  sJ y)r6   r   r   r   r   N)r!   r   r   r#   r%   s     r   r   zTestWaxmanGraph.test_metric   s(     OOBS81v||r   c                     t        j                  ddddd      }t        d |j                  j	                         D              sJ y )Nr   r   r   r   rD   rE   c              3   D   K   | ]  \  }}t        |d          dk(    ywrH   rI   rJ   s      r   r   z0TestWaxmanGraph.test_pos_name.<locals>.<genexpr>   rM   rN   )r!   r   rO   r0   rP   r%   s     r   rQ   zTestWaxmanGraph.test_pos_name   s6    OOBSrHEEQWW]]_EEEEr   N)rR   rS   rT   rU   r   r   r   rQ   rV   r   r   r   r      s    EFr   r   c                   ~    e Zd Zd Zd Zd Zd Zd Zej                  j                  d eddd	            d
        Zy)TestNavigableSmallWorldGraphc                    t        j                  dddd      }t        j                  dd      j                         }t        j                  ||      sJ t        j                  dddd      }t        j
                  g d      j                         }t        j                  ||      sJ t        j                  dddd      }t        j
                  dg      j                         }t        j                  ||      sJ y )	N   r7   r   r   )r9   qr       r9   r   rf   )r   r   r   )r!   navigable_small_world_graphgrid_2d_graphto_directedis_isomorphic
grid_graph)r&   r'   ggs      r   test_navigable_small_worldz7TestNavigableSmallWorldGraph.test_navigable_small_world   s    **1QR@a#//12&&&**1QA>]]9%1132&&&**1QA>]]A3++-2&&&r   c                     t        j                  t        j                  d      5  t        j                  dddd       d d d        y # 1 sw Y   y xY w)Nz.*p must be >= 1matchr   r   r7   r   pytestraisesr!   NetworkXExceptionr   r&   s    r   test_invalid_diameter_valuez8TestNavigableSmallWorldGraph.test_invalid_diameter_value   s@    ]]2//7IJ 	?**1QA>	? 	? 	?   A		Ac                     t        j                  t        j                  d      5  t        j                  dddd       d d d        y # 1 sw Y   y xY w)Nz.*q must be >= 0r   r   r7   r   r   r   s    r   )test_invalid_long_range_connections_valuezFTestNavigableSmallWorldGraph.test_invalid_long_range_connections_value   sD    ]]2//7IJ 	@**1RQ?	@ 	@ 	@r   c                     t        j                  t        j                  d      5  t        j                  ddddd       d d d        y # 1 sw Y   y xY w)Nz.*r must be >= 0r   r   r7   r   r   )r9   r   rrf   r   r   s    r   4test_invalid_exponent_for_decaying_probability_valuezQTestNavigableSmallWorldGraph.test_invalid_exponent_for_decaying_probability_value  sF    ]]2//7IJ 	E**1Q"!D	E 	E 	E   A

Ac                     t        j                  dddddd      }t        j                  ddt         j                        }t         j                  j                  ||      sJ y	)
z%Smoke test for radius in range [0, 1]r   r7   r   r   r,   r   )r9   r   r   rf   r    )create_usingN)r!   r   r   DiGraphutilsgraphs_equal)r&   r'   expecteds      r   test_r_between_0_and_1z3TestNavigableSmallWorldGraph.test_r_between_0_and_1  sP     **1Q#12N##AqrzzBxx$$Q111r   r    i	  i
  r   c                 &   t        j                  ddd|      }t        j                  ddd|      }t        j                  ddd|      }|j                         |j                         kD  sJ |j                         |j                         kD  sJ y)aG  The probability of adding a long-range edge scales with `1 / dist**r`,
        so a navigable_small_world graph created with r < 1 should generally
        result in more edges than a navigable_small_world graph with r >= 1
        (for 0 < q << n).

        N.B. this is probabilistic, so this test may not hold for all seeds.   r   r   )r   r   r    r7   r,   N)r!   r   number_of_edges)r&   r    G1G2G3s        r   test_r_general_scalingz3TestNavigableSmallWorldGraph.test_r_general_scaling  s     ++AcE++AadC++AadC!!#b&8&8&::::!!#b&8&8&::::r   N)rR   rS   rT   r   r   r   r   r   r   markparametrizer$   r   rV   r   r   r   r      sK    '?@E2 [[VU4r%:;; <;r   r   c                   4    e Zd ZdZd Zd Zd Zd Zd Zd Z	y)	#TestThresholdedRandomGeometricGraphzCUnit tests for :func:`~networkx.thresholded_random_geometric_graph`c                     t        j                  dddd      }t        |      dk(  sJ t        j                  t        d      ddd      }t        |      dk(  sJ y )Nr   g?r   r   r   )r!   "thresholded_random_geometric_graphr#   r$   r%   s     r   r(   z8TestThresholdedRandomGeometricGraph.test_number_of_nodes!  sR    11"c3RH1v||11%)S#BO1v||r   c                     t        j                  dddd      }t        |d      D ]H  \  }}|||   v st        j                  |j
                  |   d   |j
                  |   d         dk  rHJ  y)	r+   r   r   r   r   r   r,   r-   N)r!   r   r   r.   r/   r0   r1   s       r   r4   z2TestThresholdedRandomGeometricGraph.test_distances'  st     11"dCbI A& 	ODAqAaDyyyE!2AGGAJu4EF$NNN	Or   c                     d }t        j                  ddddd      }t        |d      D ];  \  }}|||   v s ||j                  |   d	   |j                  |   d	         dk  r;J  y
)r6   c                 :    t        d t        | |      D              S )Nc              3   >   K   | ]  \  }}t        ||z
          y wr   r   r	   s      r   r   zKTestThresholdedRandomGeometricGraph.test_p.<locals>.dist.<locals>.<genexpr>8  r_   r   r   r   s     r   r/   z8TestThresholdedRandomGeometricGraph.test_p.<locals>.dist7  r`   r   r   r   r   r7   r   )r9   r    r,   r-   Nr!   r   r   r0   ra   s        r   r:   z*TestThresholdedRandomGeometricGraph.test_p3  sw    	9 11"dC12N A& 	JDAqAaDyAGGAJu-qwwqz%/@ATIII	Jr   c                 H   ddl }t        |j                        }t        j                  |ddd      }t        |      t        |      k(  sJ t        |d      D ]H  \  }}|||   v st        j                  |j                  |   d   |j                  |   d         dk  rHJ  y)	r=   r   Nr   r   r   r   r,   r-   )
r>   r?   r@   r!   r   r#   r   r.   r/   r0   rA   s         r   rB   z3TestThresholdedRandomGeometricGraph.test_node_names@  s    V++,11%sL1vU### A& 	ODAqAaDyyyE!2AGGAJu4EF$NNN	Or   c                     t        j                  dddd      }t        |d      D ]7  \  }}|||   v s|j                  |   d   |j                  |   d   z   dk\  r7J  y)	z~Tests that pairs of vertices adjacent if and only if their sum
        weights exceeds the threshold parameter theta.
        r   r   r   r   r   r,   rx   Nr   r1   s       r   
test_thetaz.TestThresholdedRandomGeometricGraph.test_thetaM  sn     11"dCbI A& 	LDAqAaDy
8,qwwqz(/CCKKK	Lr   c                     t         j                  } |dddddd      }t        d |j                  j	                         D              sJ t        d	 |j                  j	                         D              sJ y )
Nr   r   r   r   r9   r   r   c              3   D   K   | ]  \  }}t        |d          dk(    yw)r9   r,   NrI   rJ   s      r   r   zDTestThresholdedRandomGeometricGraph.test_pos_name.<locals>.<genexpr>[  s!     @13qv;!#@rN   c              3   2   K   | ]  \  }}|d    dkD    ywr   rV   rJ   s      r   r   zDTestThresholdedRandomGeometricGraph.test_pos_name.<locals>.<genexpr>\  r   r   )r!   r   rO   r0   rP   )r&   trggr'   s      r   rQ   z1TestThresholdedRandomGeometricGraph.test_pos_nameX  s]    44T3R#4H@@@@@;177==?;;;;r   N)
rR   rS   rT   rU   r(   r4   r:   rB   r   rQ   rV   r   r   r   r     s'    M
OJO	L<r   r   c                      t        j                         } | j                  dddifdddifdddifg       ddg}|t        j                  | dd	      k(  sJ y )
Nr   position)r   r   r7   )r   r7   r,   )r7   r   )r   r,   )radiusrF   )r!   Graphadd_nodes_fromgeometric_edges)r'   expected_edgess     r   "test_geometric_edges_pos_attributer   _  sp    

AV$%V$%V$%	
 f%NR//!jQQQQr   c                      t        j                  d      } d}t        j                  t         j                  |      5  t        j
                  | d       d d d        y # 1 sw Y   y xY w)Nr   zall nodes. must have a 'r   r7   )r   )r!   
path_graphr   r   NetworkXErrorr   )r'   msgs     r   "test_geometric_edges_raises_no_posr   l  sN    
aA
$C	r''s	3 (
1Q'( ( (s   AA'c                  X    t        j                  ddddd      } t        |       dk(  sJ y )N      ?r   皙@r   r   betarK   gammamean_degreer    )r!   "geometric_soft_configuration_graphr#   r'   s    r   test_number_of_nodes_S1r   s  s/    
--Cs	A q6S==r   c                     t        j                  ddddd      } t        j                  | d      }t        |      dk(  sJ t        j                  | d      }t        |      dk(  sJ t        j                  | d	      }t        |      dk(  sJ y )
Nr   r   r   r   r   r   kappary   r   )r!   r   get_node_attributesr#   )r'   kappasthetasradiis       r   test_set_attributes_S1r  z  s    
--Cs	A ##Aw/Fv;###Aw/Fv;#""1h/Eu:r   c                     t        j                  ddddd      } t        j                  | d      }t        |j	                               t        |      z  }t        j                  |dz
        dk  sJ t        | j                               }t        |j	                               t        |      z  }t        j                  |dz
        d	k  sJ y )
Ng      @r   r   r   iW  r   r   r   r7   )
r!   r   r  r   valuesr#   r.   fabsdictdegree)r'   r  mean_kappasdegreesr   s        r   test_mean_kappas_mean_degree_S1r    s    
--Bcr	A ##Aw/Ffmmo&V4K99[2%&,,,188:Ggnn&'#g,6K99[2%&***r   c                      t        d      D  ci c]  } | d }} t        j                  d|      }t        |      dk(  sJ t        j                  |d      }t        d |j                         D              sJ y c c} w )N  r   r7   )r   r  r   c              3   &   K   | ]	  }|d k(    yw)r   NrV   )r
   r   s     r   r   z&test_dict_kappas_S1.<locals>.<genexpr>  s     8uu{8s   )r$   r!   r   r#   r  rO   r  )rg   r  r'   s      r   test_dict_kappas_S1r    sp    "4[)ae)F)
--1VDAq6T>>##Aw/F88888	 *s   
A:c                      t        j                  ddddd      } t        j                  ddddd      }t        j                  |       t        j                  |      k  sJ y )Nr   r         @r   r   r   g      @r!   r   average_clustering)r   r   s     r   test_beta_clustering_S1r    s`    		.	.Cs
B 
	.	.Cs
B   $r'<'<R'@@@@r   c                  .   t        j                  t        j                  d      5  t        j                  dddd      } d d d        t        j                  t        j                  d      5  t        d	      D ci c]  }|d }}t        j                  d|d
d      } d d d        t        j                  t        j                  d      5  t        j                  dd      } d d d        y # 1 sw Y   xY wc c}w # 1 sw Y   `xY w# 1 sw Y   y xY w)NzDPlease provide either kappas, or all 3 of: n, gamma and mean_degree.r   r   r  r   r   )r   r   r   r    z;When kappas is input, n, gamma and mean_degree must not be.r  ffffff@)r   r  r   r    )r   r    )r   r   r!   r   r   r$   )r'   rg   r  s      r   test_wrong_parameters_S1r    s    	
T
 
 11CRb
	
 

K
 
 "'t-A!R%--11V3R

 

T
 E 11sD	E E#
 
 .	
 
E Es5   C.-C?;
C:C?D.C7:C??DDc                      t        j                  t        j                  d      5  t        j                  ddddd      } d d d        y # 1 sw Y   y xY w)	Nz3The parameter beta cannot be smaller or equal to 0.r   r   r   r  r   r   r   )r   r   r!   r   r   r   s    r   test_negative_beta_S1r    sL    	
 U
 
 11s#2B

 
 
r   c                  l    t        j                  ddddd      } t        j                  |       dkD  sJ y )Nr   r   r  r   r   r   r   r  r   s    r   *test_non_zero_clustering_beta_lower_one_S1r    s8    
--Cs	A   #a'''r   c                      d} d}t        j                  ddd| d      }t        j                  ddd|d      }t        j                  |      t        j                  |      kD  sJ y )Nr,      g333333?r   r   r   r   )r!   r   number_connected_components)low_mean_degreehigh_mean_degreeG_lowG_highs       r   -test_mean_degree_influence_on_connectivity_S1r%    su    O11CsbE 22Cs0@rF ))%023Q3Q4   r   c                     t        j                  ddddd      } t        j                  ddddd      }t        j                  | d      }t        |j	                               t        |      z  }t        j                  |d      }t        |j	                               t        |      z  }t        j                  ||z
        d	k  sJ y )
Nr   r  r   r   r   r   r  r   r7   )r!   r   r  r   r  r#   r.   r  )r   r   kappas1mean_kappas1kappas2mean_kappas2s         r   ,test_compare_mean_kappas_different_gammas_S1r+    s    		.	.Bcqr
B 
	.	.Bcqr
B $$R1Gw~~'(3w<7L$$R1Gw~~'(3w<7L99\L01A555r   )r.   rd   	itertoolsr   r   networkxr!   r   r   rX   r   r   r   r   r   r   r   r   r  r  r  r  r  r  r  r%  r+  rV   r   r   <module>r.     s      "  16F 6FrEF EFPJ"1< 1<hF F4-; -;`>< ><B
R(	+9AE2
(6r   