Ë
    D^(há!  ã                   óP  — d dl Z  e j                  d«      Zd dlZd dlZd dlmZ d dlm	Z	 d a
ej                  j                  d«       ej                  j                  «       Z ej                  d«        ej                  «       Zd„ Zd„ Ze j"                  j$                  d„ «       Zy)	é    NÚnumpy)Úapproximation)Ú	thresholdé*   c                 óB  — t         dz  a t        t         dd¬«        | |i |¤Ž t        j                  j	                  «       }t
        |k(  sJ ‚t        j                  j                  d«       t        j                  «       }t        |k(  sJ ‚t        j                  d«       y)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        úf/var/www/skyplay_api_hub/venv/lib/python3.12/site-packages/networkx/tests/test_all_random_functions.pyÚtr      s|   € ô ��M€HÜ	Œ(�C˜RÕ á€tÐˆtÒä—)‘)—.‘.Ó"€Kô �KÒÐÐÜ‡I�I‡N�N�2Ôä—-‘-“/€Kô �KÒÐÐÜ
‡K�K�…Oó    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	«      }|j                  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(        j0                  |ˆ fd„¬«       t        t(        j0                  |ˆ fd„¬«       t        t         j2                  |‰ ¬«       t        t         j4                  |‰ ¬«       t        t         j6                  |‰ ¬«       t        t         j8                  j:                  j<                  |‰ ¬«       t        t         j8                  j>                  j@                  |‰ ¬«       t        t         jB                  ||‰ ¬«       t        t         j8                  j:                  jD                  ||d‰ ¬«       t        t         j8                  jF                  jH                  jJ                  ||‰ ¬«       t        t         j8                  jL                  jN                  ||‰ ¬«       g d¢}t        tP        jR                  |‰ ¬«       t        t         jT                  |‰ ¬«       t        t         jV                  ||‰ ¬«       t        t         jX                  |‰ ¬«       t        t         jZ                  |‰ ¬«       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         j`                  |‰ ¬«       t        t         jb                  |je                  «       ‰ ¬«       ddddœ}t        t         jf                  jh                  ||‰ ¬«       t        t         jf                  jj                  |‰ ¬«       t        t         j8                  jl                  jT                  ||‰ ¬«       t        t         j8                  jl                  jn                  ||‰ ¬«       d „ }t        t         jp                  ||‰ ¬«       g d!¢}g d"¢g d#¢g d$¢g} t        t         jr                  || ‰ ¬«       t        t         jt                  |||‰ ¬«       t        tP        jv                  ||‰ ¬«       t        t         jx                  jz                  |‰ ¬«       t        t         j|                  |||‰ ¬«       t        t         j~                  ||||‰ ¬«       t        t         j€                  |||||‰ ¬«       t        t         j‚                  |‰ ¬«       t        t         j„                  ||‰ ¬«       t        t         j†                  |‰ ¬«       t        t         jˆ                  |‰ ¬«       t        t         jŠ                  jŒ                  ||‰ ¬«       t        t         jŽ                  |||‰ ¬«       d%}!t        t         j�                  |!|||‰ ¬«       t        t         j’                  ||‰ ¬«       t        t         j”                  ||‰ ¬«       t        t         j–                  ||‰ ¬«       t        t         j˜                  ||‰ ¬«       t        t         jš                  |‰ ¬«       t        t         jœ                  |‰ ¬«       t        t         jž                  |||‰ ¬«       t        t         j                   |||‰ ¬«       t        t         j¢                  |||‰ ¬«       t        t         j¤                  |dd&d'g‰ ¬«       t        t         j¦                  ||‰ ¬«       t        t         j¨                  ||‰ ¬«       t        t         jª                  ||‰ ¬«       t        t         j¬                  ||‰ ¬«       t        t         j®                  |||‰ ¬«       t        t         j°                  |||‰ ¬«       t        t         j²                  |||‰ ¬«       t        t         j´                  d	|‰ ¬«       t        t         j¶                  ||‰ ¬«       t        t         j¸                  ||||‰ ¬«       t        t         jº                  |||‰ ¬«       t        t         j¼                  ||	|
‰ ¬«       t        t         j¾                  |‰ d(¬)«       t        t         jÀ                  d‰ d(¬)«       t        t         jÂ                  |‰ ¬«       t        t         jf                  jÄ                  |‰ ¬«       t        t         jf                  jÆ                  d*‰ ¬«       g d+¢}"t        t         jf                  jÈ                  ||"‰ ¬,«       t        t         j8                  jl                  jÊ                  |||‰ ¬«       t        t         j8                  jl                  jÌ                  |||‰ ¬«       t         jÎ                  jÐ                  }#t        |#d-d	d.d&d	d‰ d¬/«	       t        t         jÒ                  |‰ ¬«       y )0Né   é
   é   çš™™™™™Ù?g      è?)r   r   r   )r   r   é   é   r!   c              3   ó,   K  — | ]  \  }}||d f–— Œ y­w)çš™™™™™É?N© )Ú.0ÚuÚvs      r   ú	<genexpr>z+run_all_random_functions.<locals>.<genexpr>3   s   è ø€ Ò>©d¨a°˜q ! SœkÑ>ùs   ‚)r!   r   r   r!   r   r   r!   r   r   r   r   r   r   ©r   F)r   Ú
normalizedr   é	   Úgreedy)Úsourcer   c                 ó6   •— t        j                  | d|‰¬«      S ©Nr-   r*   )ÚapproxÚsimulated_annealing_tsp©ÚGÚweightr   s     €r   ú<lambda>z*run_all_random_functions.<locals>.<lambda>O   ó   ø€ ¤×!?Ñ!?Øˆx˜ dô"
€ r   )Úmethodc                 ó6   •— t        j                  | d|‰¬«      S r0   )r1   Úthreshold_accepting_tspr3   s     €r   r6   z*run_all_random_functions.<locals>.<lambda>V   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   € Ø�1‰uˆr   )éK   rG   i,  )g      Ð?çš™™™™™©?ç{®Gáz”?)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)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_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Úrandom_triadÚto_directedÚ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Ø€I€AˆØ€J€AˆØ%(Ð(€AÐ(ˆÐ(ˆBÐ(�Ð(�d˜UØ!Ð!€EÐ!ˆF�UØ€EÚ€FÜ
×Ñ˜˜RÓ €AÜ
�‰�qÓ€AØ×ÑÑ>°a·g±gÔ>Ô>Ú:€LØ6BÐBÐÐB˜ÐB˜XÐB¨¨tô „b× Ñ  !¨$Õ/Ü„b×Ñ ¨¸Õ?Ü„b×Ñ˜1 4Õ(Ü„b×Ñ˜A DÕ)Ü„b‡h�h��1�a˜dÕ#Ü„b‡h�h��1�a˜dÕ#ä„b×Ñ˜1 4Õ(ä„b×#Ñ#¤R×%6Ñ%6°qÓ%9ÀÕEä„b×Ñ˜ Õ%Ü„b×$Ñ$ a¨dÕ3Ü„b×Ñ ¨Õ.Ü„b×Ñ˜ Õ&Ü„b×Ñ˜A DÕ)ä„f×Ñ ¨Õ.Ü„f×$Ñ$ a¨¸!À$ÕGÜ„f×$Ñ$ a¨¸!À$ÕGÜÜ×)Ñ)Ø	ó
õô Ü×)Ñ)Ø	ó
õô „b×Ñ ¨Õ.Ü„b×$Ñ$ a¨dÕ3Ü„b×8Ñ8¸!À$ÕGä„b‡m�m×Ñ×5Ñ5°q¸tÕDä„b‡m�m×Ñ×)Ñ)¨1°4Õ8ô „b×Ñ˜q %¨dÕ3Ü„b‡m�m×Ñ×)Ñ)¨1¨a¸!À$ÕGÜÜ
�‰×"Ñ"×4Ñ4×OÑOØ	Ø	Øõ	ô „b‡m�m×Ñ×7Ñ7¸¸FÈÕNâ	'€BÜ„i×Ñ˜ Õ&Ü„b×Ñ˜l°Õ6ÜÜ
×'Ñ'ØØØõ	ô „b×Ñ ¨Õ-Ü„b×%Ñ% x°dÕ;àˆqˆ6Ø�Q˜1ÑØ�Q‰<Ø�Q˜1Ññ	€Mô „b×Ñ˜]°Õ6ò	Ðô „b×ÑÐ!6¸TÕBØ Ð.€KÜ„b×Ñ˜[¨tÕ4Ü„b‡o�o�q—}‘}“¨TÕ2Ø˜# #Ñ&€GÜ„b‡h�h×%Ñ% w°¸Õ=Ü„b‡h�h×Ñ ¨dÕ3Ü„b‡m�m×Ñ×1Ñ1°4¸ÀDÕIÜ„b‡m�m×Ñ×;Ñ;¸TÀ1È4ÕPòô „b×Ñ˜a °tÕ<â€EÚÒ!3Ò5GÐH€EÜ„b×Ñ ¨°DÕ9Ü„b×Ñ ¨¨e¸$Õ?ô „i×)Ñ)¨1¨a°dÕ;Ü„b‡m�m×%Ñ% q¨tÕ4Ü„b×Ñ  1 a¨dÕ3Ü„b× Ñ  ! Q¨¨e¸$Õ?Ü„b×(Ñ(¨!¨Q°°4¸ÀTÕJÜ„b‡k�k�1˜4Õ Ü„b‡l�l�A�q˜tÕ$Ü„b‡l�l�A˜DÕ!Ü„b×Ñ˜1 4Õ(Ü„b‡k�k×,Ñ,¨a°¸Õ>Ü„b×Ñ˜Q  5¨tÕ4Ø€AÜ„b×"Ñ" A q¨!¨Q°TÕ:Ü„b×%Ñ% q¨!°$Õ7Ü„b×Ñ  F°Õ6Ü„b×$Ñ$ a¨°dÕ;Ü„b×%Ñ% q¨%°dÕ;Ü„b‡o�o�q˜tÕ$Ü„b×$Ñ$ a¨dÕ3Ü„b×+Ñ+¨Q°¸ÀDÕIÜ„b×*Ñ*¨A¨q°!¸$Õ?Ü„b×$Ñ$ a¨¨A°DÕ9ä„b×*Ñ*¨A¨q°3¸°*À4ÕHÜ„b×Ñ  1¨4Õ0Ü„b×Ñ˜1˜a dÕ+Ü„b×Ñ  A¨DÕ1Ü„b×Ñ˜1˜a dÕ+Ü„b×$Ñ$ a¨¨A°DÕ9Ü„b×Ñ˜q ! Q¨TÕ2Ü„b×'Ñ'¨¨A¨q°tÕ<Ü„b×Ñ˜q !¨$Õ/Ü„b×Ñ  1¨4Õ0Ü„b×'Ñ'¨¨A¨q°!¸$Õ?Ü„b×Ñ  A q¨tÕ4Ü„b×Ñ˜˜B ¨Õ.Ü„b×Ñ˜q t°4Õ8Ü„b×&Ñ&¨°¸TÕBÜ„b×Ñ˜a dÕ+Ü„b‡h�h× Ñ  !¨$Õ/Ü„b‡h�h×Ñ˜ $Õ'Ú*€EÜ„b‡h�h× Ñ  !°5¸tÕDÜ„b‡m�m×Ñ×*Ñ*¨A¨q°!¸$Õ?Ü„b‡m�m×Ñ×/Ñ/°°A°q¸tÕDÜ
�-‰-×
+Ñ
+€CÜØØ
Ø	ØØØØØØõ
ô „b×!Ñ! 1¨4Ö0r   c                  ób  — dt         j                  j                  d«      fD ]‹  } t         j                  j                  d«       t        j                  d«       t	        | «       dat         j                  j                  «       }t        |k(  sJ ‚t        j                  «       }t        |k(  rŒ‹J ‚ y )Né   r   r   )	r   r   ÚRandomStater   rÕ   r   r   r   r   )r   r   r   s      r   Útest_rng_interfacerÙ   á   sŒ   € ð ”R—Y‘Y×*Ñ*¨2Ó.Ð/ò $ˆÜ
�	‰	�‰�rÔÜ�‰�BŒÜ  Ô&Øˆô —i‘i—n‘nÓ&ˆô ˜Ò#Ð#Ð#Ü—m‘m“oˆô ˜Ó#Ð#Ð#ñ$r   )ÚpytestÚimportorskipr   r   ÚnetworkxrQ   Únetworkx.algorithmsr   r1   r   r   r   r   r   r   r   rÕ   ÚmarkÚslowrÙ   r%   r   r   ú<module>rà      s‘   ðÛ à€V×Ñ˜Ó!€Û ã Ý 7Ý )à€ð ‡	�	‡�ˆrÔ Ø
�	‰	�‰Ó€Ø €‡�ˆB„Øˆ�‰‹€òò*o1ðr ‡�×Ññ$ó ñ$r   