+
    �°³j  ã                   óÐ   € R t ^ RIHt ^ RIt^ RIHt ^ RIHtHtH	t	H
t
HtHtHtHt R tR tR tR tR	 tR
 tR tR tR tR tR tR tR tR tR tR tR tR t R t!R t"R t#R# )z@Unit tests for the :mod:`networkx.algorithms.tournament` module.)ÚcombinationsN)ÚDiGraph)Úhamiltonian_pathÚindex_satisfyingÚis_reachableÚis_strongly_connectedÚis_tournamentÚrandom_tournamentÚscore_sequenceÚtournament_matrixc                  ó4   € ^ .p \        V R 4      ^8X  g   Q hR# )é    c                 ó   € V ^ 8„  # ©r   © ©Úxs   &Új/home/luca/screen-checking/.venv/lib/python3.14/site-packages/networkx/algorithms/tests/test_tournament.pyÚ<lambda>Ú.test_condition_not_satisfied.<locals>.<lambda>   s   € ¨q°1ªuó    N)r   )Úiter_ins    r   Útest_condition_not_satisfiedr      s   € Øˆc€GÜ˜G¡_Ó5¸Ô:Ð:Ò:r   c                  óž   € \         P                  ! \        4      ;_uu_ 4        \        . R  4       RRR4       R#   + '       g   i     R# ; i)c                 ó   € V ^ 8„  # r   r   r   s   &r   r   Ú%test_empty_iterable.<locals>.<lambda>   s   €  q¨1¢ur   N)ÚpytestÚraisesÚ
ValueErrorr   r   r   r   Útest_empty_iterabler      s*   € Ü	�Š”z×	"Õ	"Ü˜™_Ô-÷ 
#×	"×	"Ò	"ús	   £;»A	c                  óf   € \        4       p V P                  . RO4       \        V 4      '       g   Q hR# )r   N©©r   é   ©r#   é   ©r%   é   ©r'   r   ©r#   r'   ©r   r%   ©r   Úadd_edges_fromr   ©ÚGs    r   Útest_is_tournamentr/      s)   € Ü‹	€AØ×ÑÒEÔFÜ˜×ÒÐÒr   c                 óŠ   € \        4       p V P                  . RO4       V P                  ^ ^ 4       \        V 4      '       d   Q hR# )z%A tournament must have no self-loops.Nr!   ©r   r,   Úadd_edger   r-   s    r   Útest_self_loopsr3   $   s:   € ä‹	€AØ×ÑÒEÔFØ‡J�Jˆq�!ÔÜ˜Q×ÒÐÐÑr   c                 óf   € \        4       p V P                  . RO4       \        V 4      '       d   Q hR# )zZA tournament must not have any pair of nodes without at least
one edge joining the pair.

N)r"   r$   r&   r(   r)   r+   r-   s    r   Útest_missing_edgesr5   ,   s.   € ô
 	‹	€AØ×ÑÒ=Ô>Ü˜Q×ÒÐÐÑr   c                 óŠ   € \        4       p V P                  . RO4       V P                  ^^ 4       \        V 4      '       d   Q hR# )z[A tournament must not have any pair of nodes with greater
than one edge joining the pair.

Nr!   r1   r-   s    r   Útest_bidirectional_edgesr7   6   s<   € ô
 	‹	€AØ×ÑÒEÔFØ‡J�Jˆq�!ÔÜ˜Q×ÒÐÐÑr   c                  óf   € \        ^
4       F!  p \        ^4      p\        V4      '       d   K!  Q h	  R# )é
   N©Úranger	   r   ©Ú_r.   s     r   Útest_graph_is_tournamentr>   A   s+   € Ü�2ŽYˆÜ˜aÓ ˆÜ˜Q×ÔÐÐó r   c                  ój   € \        ^
4       F#  p \        ^^R7      p\        V4      '       d   K#  Q h	  R# )r9   )ÚseedNr:   r<   s     r   Útest_graph_is_tournament_seedrA   G   s-   € Ü�2ŽYˆÜ˜a aÔ(ˆÜ˜Q×ÔÐÐó r   c                  óB   € \        ^4      p \        V 4      '       g   Q hR# )r#   N©r	   r   r-   s    r   Ú!test_graph_is_tournament_one_noderD   M   ó   € Ü˜!Ó€AÜ˜×ÒÐÒr   c                  óB   € \        ^ 4      p \        V 4      '       g   Q hR# ©r   NrC   r-   s    r   Ú"test_graph_is_tournament_zero_noderH   R   rE   r   c                  óP   € \        \        4       4      p \        V 4      ^ 8X  g   Q hR# rG   )r   r   Úlen)Úpaths    r   Útest_hamiltonian_empty_graphrL   W   s   € ÜœG›IÓ&€DÜˆt‹9˜Œ>ÐŠ>r   c                  ó@  a€ \        4       oSP                  . RO4       \        S4      p \        V 4      ^8X  g   Q h\        ;QJ d/    V3R l\        W R,          4       4       F  '       d   K   RM$	  RM ! V3R l\        W R,          4       4       4      '       g   Q hR# )r   c              3   ó@   <"  € T F  w  rVSV,          9   x € K  	  R # 5i©Nr   ©Ú.0ÚuÚvr.   s   &  €r   Ú	<genexpr>Ú+test_path_is_hamiltonian.<locals>.<genexpr>a   ó   øé € Ð9Ñ%8™T˜Qˆq�A�a•DŽyÓ%8ùó   ƒºr#   NNFTNr!   ©r   r,   r   rJ   ÚallÚzip©rK   r.   s    @r   Útest_path_is_hamiltonianr]   \   sl   ø€ Ü‹	€AØ×ÑÒEÔFÜ˜AÓ€DÜˆt‹9˜Œ>Ðˆ>ß‹3Ô9¤S¨°B­xÔ%8Ó9�3�3Š3Ô9¤S¨°B­xÔ%8Ó9×9Ò9Ð9Ò9r   c                 ó|  a€ \        4       oSP                  . RO4       \        S4      p \        V 4      ^8X  g   Q h\        ;QJ d/    V3R l\        W R,          4       4       F  '       d   K   RM$	  RM ! V3R l\        W R,          4       4       4      '       g   Q hV ^ ,          SV R,          ,          9   g   Q hR# )z„Tests that :func:`networkx.tournament.hamiltonian_path`
returns a Hamiltonian cycle when provided a strongly connected
tournament.

c              3   ó@   <"  € T F  w  rVSV,          9   x € K  	  R # 5irO   r   rP   s   &  €r   rT   Ú)test_hamiltonian_cycle.<locals>.<genexpr>n   rV   rW   rX   FTNr!   éÿÿÿÿrY   r\   s    @r   Útest_hamiltonian_cyclerb   d   sˆ   ø€ ô 	‹	€AØ×ÑÒEÔFÜ˜AÓ€DÜˆt‹9˜Œ>Ðˆ>ß‹3Ô9¤S¨°B­xÔ%8Ó9�3�3Š3Ô9¤S¨°B­xÔ%8Ó9×9Ò9Ð9Ð9Ø��7�a˜˜R�•kÔ!Ð!Ò!r   c                  óF   € \        R.4      p \        V 4      ^ ^.8X  g   Q hR# )r   Nr"   ©r   r
   r-   s    r   Útest_score_sequence_edgere   r   s%   € Ü��Ó€AÜ˜!Ó  A Ô&Ð&Ò&r   c                  óH   € \        . RO4      p \        V 4      . RO8X  g   Q hR# )r   N©r"   r$   )r%   r   )r#   r#   r#   rd   r-   s    r   Útest_score_sequence_trianglerh   w   s    € ÜÒ(Ó)€AÜ˜!Ó¢	Ô)Ð)Ò)r   c                  ó  € \         P                  ! R 4      p \         P                  ! R4       V P                  p\        R.4      p\	        V4      pVP                  VP                  4       V P                  ^ ^.R^ ..4      4       R# )ÚnumpyÚscipyNr"   ra   )r   ÚimportorskipÚtestingr   r   Úassert_array_equalÚtodenseÚarray)ÚnpÚnptr.   Úms       r   Útest_tournament_matrixrt   |   sk   € Ü	×	Ò	˜WÓ	%€BÜ
×Ò˜Ô Ø
�*‰*€CÜ��Ó€AÜ˜!Ó€AØ×Ñ˜1Ÿ9™9›;¨¯©°1°a°&¸2¸q¸'Ð1BÓ(CÖDr   c                 óJ   € \        . RO4      p \        V ^ ^4      '       g   Q hR# )z$Tests for a reachable pair of nodes.Nrg   ©r   r   r-   s    r   Útest_reachable_pairrw   …   s"   € äÒ(Ó)€AÜ˜˜1˜a× Ò Ð Ò r   c                 óÖ   a € \        R \        \        ^
4      ^4       4       4      o \        ;QJ d    V 3R lS  4       F  '       d   K   RM	  RM! V 3R lS  4       4      '       g   Q hR# )z.Tests that a node is always reachable from it.c              3   ó8   "  € T F  p\        V4      x € K  	  R # 5irO   )Úsorted)rQ   Úps   & r   rT   Ú.test_same_node_is_reachable.<locals>.<genexpr>Ž   s   é € Ð>Ñ#=˜a”�q—	�	Ó#=ùs   ‚c              3   ó<   <"  € T F  p\        SW4      x € K  	  R # 5irO   )r   )rQ   rS   r.   s   & €r   rT   r|   �   s   øé € Ð0©a¨Œ|˜A˜q×$Ð$«aùs   ƒFTN)r   r   r;   rZ   r-   s   @r   Útest_same_node_is_reachabler~   ‹   sG   ø€ ô 	Ñ>¤<´°b³	¸1Ô#=Ó>Ó>€Aß‹3Ô0©aÓ0�3�3Š3Ô0©aÓ0×0Ò0Ð0Ò0r   c                 óJ   € \        . RO4      p \        V ^^ 4      '       d   Q hR# )z'Tests for an unreachable pair of nodes.N©r"   r*   r$   rv   r-   s    r   Útest_unreachable_pairr�   ’   s%   € äÒ(Ó)€AÜ˜A˜q !×$Ò$Ð$Ð$Ñ$r   c                 óF   € \        . RO4      p \        V 4      '       g   Q hR# )z*Tests for a strongly connected tournament.Nrg   ©r   r   r-   s    r   Útest_is_strongly_connectedr„   ˜   s   € äÒ(Ó)€AÜ  ×#Ò#Ð#Ò#r   c                 óF   € \        . RO4      p \        V 4      '       d   Q hR# )z6Tests for a tournament that is not strongly connected.Nr€   rƒ   r-   s    r   Útest_not_strongly_connectedr†   ž   s!   € äÒ(Ó)€AÜ$ Q×'Ò'Ð'Ð'Ñ'r   )$Ú__doc__Ú	itertoolsr   r   Únetworkxr   Únetworkx.algorithms.tournamentr   r   r   r   r   r	   r
   r   r   r   r/   r3   r5   r7   r>   rA   rD   rH   rL   r]   rb   re   rh   rt   rw   r~   r�   r„   r†   r   r   r   Ú<module>r‹      sŠ   ðÙ Få "ã å ÷	÷ 	ó 	ò;ò
.ò
ò ò ò ò ò òò
ò
ò
:ò"ò'ò
*ò
Eò!ò1ò%ò$ô(r   