
    fi!                     4   d dl Z d dlZd dlZd dlmZ d dlmZ  ej        d          Z	d a
e	j                             d           e	j                                         Z e j        d            e j                     Zd Zd Zej        j        d             ZdS )	    N)approximation)	thresholdnumpy*   c                 T   t           dz  a t          t           dd            | |i | t          j                                        }t
          |k    sJ t          j                            d           t          j                    }t          |k    sJ t          j        d           dS )z1call one function and check if global RNG changed   , )endr   N)progressprintnprandomrandnp_rvseedpy_rv)fargskwdsafter_np_rvafter_py_rvs        /var/www/development/aibuddy-work/election-extract/venv/lib/python3.11/site-packages/networkx/tests/test_all_random_functions.pytr      s     MH	(CR    Att)..""K KINN2-//K K
KOOOOO    c                 >    d}d}dx}}dx}}dx}x}x}	x}
x}}dx}x}}d}g d}t          j        dd          }t          j        d	          }|                    d
 |j        D                        g d}|x}x}x}x}}t          t           j        |            t          t           j        | d           t          t           j        |            t          t           j	        |            t          t           j
        |dd            t          t           j        |dd            t          t           j        |            t          t           j        t          j        d                      t          t           j        |            t          t           j        |            t          t           j        |            t          t           j        |            t          t           j        |            t          t(          j        |            t          t(          j        |dd            t          t(          j        |dd            t          t(          j        | fd           t          t(          j        | fd           t          t           j        |            t          t           j        |            t          t           j        |            t          t           j        j        j        |            t          t           j        j        j         |            t          t           j!        ||            t          t           j        j        j"        ||d            t          t           j        j#        j$        j%        ||            t          t           j        j&        j'        ||            g d}t          tP          j)        |            t          t           j*        |            t          t           j+        ||            t          t           j,        |            t          t           j-        |            ddidddddddddddd}t          t           j.        |            g d}t          t           j/        |            ddg}t          t           j0        |            dddd}t          t           j1        j2        ||            t          t           j1        j3        |            t          t           j        j4        j*        ||            t          t           j        j4        j5        ||            d  }t          t           j6        ||            g d!}g d"g d#g d$g} t          t           j7        ||             t          t           j8        |||            t          tP          j9        ||            t          t           j:        j;        |            t          t           j<        |||            t          t           j=        ||||            t          t           j>        |||||            t          t           j?        |            t          t           j@        ||            t          t           jA        |            t          t           jB        |            t          t           jC        jD        ||            t          t           jE        |||            d%}!t          t           jF        |!|||            t          t           jG        ||            t          t           jH        ||            t          t           jI        ||            t          t           jJ        ||            t          t           jK        |            t          t           jL        |            t          t           jM        |||            t          t           jN        |||            t          t           jO        |||            t          t           jP        |dd&d'g            t          t           jQ        ||            t          t           jR        ||            t          t           jS        ||            t          t           jT        ||            t          t           jU        |||            t          t           jV        |||            t          t           jW        |||            t          t           jX        d	|            t          t           jY        ||            t          t           jZ        ||||            t          t           j[        |||            t          t           j\        ||	|
            t          t           j]        | d()           t          t           j^        d d()           t          t           j_        |            t          t           j1        j`        |            t          t           j1        ja        d*            g d+}"t          t           j1        jb        ||" ,           t          t           j        j4        jc        |||            t          t           j        j4        jd        |||            t           je        jf        }#t          |#d-d	d.d&d	d d/	  	         t          t           jg        |            d S )0N   
      皙?g      ?)r   r   r   )r   r         r!   c              3   &   K   | ]\  }}||d fV  dS )皙?N ).0uvs      r   	<genexpr>z+run_all_random_functions.<locals>.<genexpr>4   s,      >>daq!Sk>>>>>>r   )r!   r   r   r!   r   r   r!   r   r   r   r   r   r   r   F)r   
normalizedr   	   greedy)sourcer   c                 4    t          j        | d|          S Nr-   r*   )approxsimulated_annealing_tspGweightr   s     r   <lambda>z*run_all_random_functions.<locals>.<lambda>P   "    !?xd"
 "
 "
 r   )methodc                 4    t          j        | d|          S r0   )r1   threshold_accepting_tspr3   s     r   r6   z*run_all_random_functions.<locals>.<lambda>W   r7   r   )max_iterr   )dir=   r<   r<   r=      )r   r!   r>   )r   r>   )r   r   r!   r>   )r   r   r?   r?   )r   r   r?   )r   r   r   r   r@   )r!   r!         ?)r   r   ffffff?g333333?c                     ||z
  S )Nr%   )r'   wzs      r   kernel_integralz1run_all_random_functions.<locals>.kernel_integral   s    1ur   )K   rG   i,  )g      ?皙?{Gz?)rH   gffffff?Q?)rI   rJ   r    i  g?rA   i  )r   triesgffffff@)r$   r    rA   rB   g?g      ?)cdistributionr      g      ?)average_degreemin_communityr   max_community)hnxbarbell_graphcycle_graphadd_weighted_edges_fromedgesr   maximal_independent_setrich_club_coefficientrandom_referencelattice_referencesigmaomegadouble_edge_swapconnected_double_edge_swapcomplete_graphrandom_layoutfruchterman_reingold_layoutalgebraic_connectivityfiedler_vectorspectral_orderingr1   average_clusteringr2   r:   traveling_salesman_problembetweenness_centralityedge_betweenness_centrality/approximate_current_flow_betweenness_centrality
algorithms	communitykernighan_lin_bisectiontreegreedy_branchingspectral_graph_forgeasyn_fluidcconnectivityedge_augmentationgreedy_k_edge_augmentationcoloringstrategy_random_sequentialr   swap_dconfiguration_modeldirected_configuration_modelexpected_degree_graphrandom_degree_sequence_graphjoint_degree_graphrandom_clustered_graphrandom_shell_graphutilsrandom_weighted_sampleweighted_choice	bipartitepreferential_attachment_graphrandom_kernel_graphstochastic_block_modelrandom_partition_graphrandom_threshold_sequence
tournamentrandom_tournamentrelaxed_caveman_graphplanted_partition_graphgaussian_random_partition_graphgn_graph	gnr_graph	gnc_graphscale_free_graphdirectedrandom_uniform_k_out_graphrandom_k_out_graphpartial_duplication_graphduplication_divergence_graphrandom_geometric_graphsoft_random_geometric_graphgeographical_threshold_graphwaxman_graphnavigable_small_world_graph"thresholded_random_geometric_graph!uniform_random_intersection_graphk_random_intersection_graph!general_random_intersection_graphfast_gnp_random_graphgnp_random_graphdense_gnm_random_graphgnm_random_graphnewman_watts_strogatz_graphwatts_strogatz_graphconnected_watts_strogatz_graphrandom_regular_graphbarabasi_albert_graphextended_barabasi_albert_graphpowerlaw_cluster_graphrandom_lobsterrandom_powerlaw_treerandom_powerlaw_tree_sequencerandom_labeled_treepowerlaw_sequencezipf_rvdiscrete_sequencerandom_graphgnmk_random_graph
generatorsLFR_benchmark_graphrandom_internet_as_graph)$r   nmklsr(   pqp1p2p_inp_outalpharadiusthetasizescolorsr4   Hdeg_sequencein_degree_sequencerD   sequenceaseqbseqcsjoint_degreesjoint_degree_sequenceconstructormappingrF   probsNcdistLFRs$   `                                   r   run_all_random_functionsr   )   s
   
A
AIAJA%((A((B((dU!!E!FUEYYF
R  A
qA>>ag>>>>>>:::L6BBBBXBt b !$////b????b14((((bAD))))bh1ad####bh1ad####b14((((b#R%6q%9%9EEEEb%%%%b$ad3333b....b&&&&bAD))))f....f$a!$GGGGf$a!$GGGG)	
 
 
 
    )	
 
 
 
    b....b$ad3333b8!$GGGGbm5qtDDDDbm)148888 bq%d3333bm)1a!$GGGG
"4O			    bm7FNNNN	'	'	'Bi&&&&bl6666
'	    b----b%xd;;;;q6Q1Q<<Q1	 M b]6666	 	 	 b!6TBBBB.Kb[t4444##&&Gbh%w====bhd3333bm14DIIIIbm;T14PPPP   bat<<<<MME!3!3!35G5G5GHEbD9999be$???? i)1ad;;;;bm%qt4444b1ad3333b !Qe$????b(!Q4TJJJJbk14    blAqt$$$$blAD!!!!b14((((bk,a>>>>bQ5t4444Ab"Aq!QT::::b%q!$7777bF6666b$ad;;;;b%q%d;;;;boqt$$$$b$ad3333b+QDIIIIb*Aq!$????b$aAD9999b*Aq3*4HHHHb140000b1ad++++bAD1111b1ad++++b$aAD9999bq!QT2222b'Aqt<<<<bq!$////b140000b'Aq!$????bAqt4444bB....bqt48888b&TBBBBbad++++bh !$////bh$''''***Ebh !5tDDDDbm*Aq!$????bm/AqtDDDD
-
+C
	
 
 
 
 b!14000000r   c                  l   dt           j                            d          fD ]} t           j                            d           t          j        d           t	          |            dat           j                                        }t          |k    sJ t          j                    }t          |k    sJ d S )N   r   r   )	r   r   RandomStater   r   r   r   r   r   )r   r   r   s      r   test_rng_interfacer      s     RY**2../ $ $
	rB &&& inn&& ####moo #####$ $r   )r   pytestnetworkxrQ   networkx.algorithmsr   r1   r   importorskipr   r   r   r   r   r   r   r   markslowr   r%   r   r   <module>r      s          7 7 7 7 7 7 ) ) ) ) ) )V!! 	r   
	 B  *n1 n1 n1p $ $ $ $ $r   