o
    ˷e!                     @   s   d dl Z e dZd dlZd dlZd dlmZ d dlm	Z	 d a
ejd ej Zed e Zdd Zdd	 Ze jjd
d ZdS )    Nnumpy)approximation)	threshold*   c                 O   sh   t d7 a tt ddd | |i | tj }t|ksJ tjd t }t|ks-J t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_rv r   _/var/www/ideatree/venv/lib/python3.10/site-packages/networkx/tests/test_all_random_functions.pyt   s   
r   c           $         s  d}d}d }}d }}d } } }	 }
 }}d } }}d}g d}t dd}t d	}|d
d |jD  g d}| } } } }}tt j| d tt j| dd tt j| d tt j	| d tt j
|dd d tt j|dd d tt j| d tt jt d d tt j| d tt j| d tt j| d tt j| d tt j| d ttj| d ttj|dd d ttj|dd d ttj| fddd ttj| fddd tt j| d tt j| d tt j| d tt j| d tt jjj| d tt jj j!| d tt jj j"| d tt j#|| d tt jjj$||d d tt jj%j&j'|| d tt jj(j)|| d g d}tt*j+| d tt j,| d tt j-|| d tt j.| d tt j/| d ddidddddddddddd}tt j0| d g d}tt j1| d dd g}tt j2| d dd!d!d}tt j3j4|| d tt j3j5| d tt jj6j,|| d tt jj6j7|| d d"d# }tt j8|| d g d$}g d%g d&g d'g} tt j9||  d tt j:||| d tt*j;|| d tt j<j=| d tt j>||| d tt j?|||| d tt j@||||| d tt jA| d tt jB|| d tt jC| d tt jD| d tt jEjF|| d tt jG||| d d(}!tt jH|!||| d tt jI|| d tt jJ|| d tt jK|| d tt jL|| d tt jM| d tt jN| d tt jO||| d tt jP||| d tt jQ||| d tt jR|dd)d*g d tt jS|| d tt jT|| d tt jU|| d tt jV|| d tt jW||| d tt jX||| d tt jY||| d tt jZd	| d tt j[|| d tt j\|||| d tt j]||| d tt j^||	|
 d tt j_| d+d, tt j`d d+d, tt ja| d tt j3jb| d tt j3jcd- d g d.}"tt j3jd||" d/ tt jj6je||| d tt jj6jf||| d t jgjh}#t|#d0d	d1d)d	d dd2	 tt ji| d d S )3N   
      皙?g      ?)r   r   r   )r   r         r   c                 s   s    | ]
\}}||d fV  qdS )皙?Nr   ).0uvr   r   r   	<genexpr>3   s    z+run_all_random_functions.<locals>.<genexpr>)r   r   r   r   r   r   r   r   r   r   r   r   r   r   F)r   
normalizedr   	   greedy)sourcer   c                       t j| d| dS Nr(   r%   )approxsimulated_annealing_tspGwtr%   r   r   <lambda>O       z*run_all_random_functions.<locals>.<lambda>)methodc                    r*   r+   )r,   threshold_accepting_tspr.   r%   r   r   r1   T   r2   )max_iterr   )dir7   r6   r6   r7      )r   r   r8   )r   r8   )r   r   r   r8   )r   r   r9   r9   )r   r   r9   )r   r   r   r   r:   )r   r         ?)r   r   ffffff?g333333?c                 S   s   || S )Nr   )r"   wzr   r   r   kernel_integral   s   z1run_all_random_functions.<locals>.kernel_integral)K   r@   i,  )g      ?皙?{Gz?)rA   gffffff?Q?)rB   rC   r   i  g?r;   i  )r   triesgffffff@)r    r   r;   r<   g?g      ?)cdistributionr      g      ?)average_degreemin_communityr   max_community)j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_orderingr,   average_clusteringr-   r4   traveling_salesman_problembetweenness_centralityedge_betweenness_centralityedge_betweenness/approximate_current_flow_betweenness_centrality
algorithms	communitykernighan_lin_bisectiontreegreedy_branchingEdmonds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_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colorsr/   Hdeg_sequencein_degree_sequencer=   sequenceaseqbseqcsjoint_degreesjoint_degree_sequenceconstructormappingr?   probsNcdistLFRr   r%   r   run_all_random_functions(   s   






r   c                  C   sf   dt jdfD ](} t jd td t|  dat j }t|ks&J t }t|ks0J qd S )N   r   r   )	r   r   RandomStater   r   r
   r   r   r   )r   r   r   r   r   r   test_rng_interface   s   

r   )pytestimportorskipr   r   networkxrJ   networkx.algorithmsr   r,   r   r
   r   r   r   r   r   r   markslowr   r   r   r   r   <module>   s     


 7