
    h                        S r SSKrSSKr\R                  " S5      r\R                  " S5      S\R                  " S5      S\R                  " S5      S	\R                  " 5       S
0r	\R                  " S5      S\R                  " S5      S\R                  " S5      S\R                  " 5       S\R                  " S5      S0r\R                  R                  S\	R                  5       5      S 5       r\R                  R                  S\	R!                  5       5      S 5       r\R                  R                  S\R                  5       5      S 5       r\R                  R                  S\R!                  5       5      S 5       rg)zAUnit tests for the :mod:`networkx.algorithms.polynomials` module.    Nsympy   1   z1x**3 + 3*x**2 + 4*x*y + 2*x + y**3 + 3*y**2 + 2*y   zx**4 + x**3 + x**2 + x + yz$x**3 + 2*x**2 + 2*x*y + x + y**2 + yxzx**4 - 6*x**3 + 11*x**2 - 6*xz'x**5 - 5*x**4 + 10*x**3 - 10*x**2 + 4*xzx**4 - 5*x**3 + 8*x**2 - 4*xz#x**5 - 4*x**4 + 6*x**3 - 4*x**2 + xGexpectedc                 \    [         R                  " U 5      R                  U5      (       d   eg N)nxtutte_polynomialequalsr	   s     \/var/www/html/env/lib/python3.13/site-packages/networkx/algorithms/tests/test_polynomials.pytest_tutte_polynomialr      s$    q!((2222    r
   c                     [         R                  " U 5      n[         R                  " X 5      n[         R                  " U5      n[        R	                  X-  5      R                  U5      (       d   eg)zTutte polynomial factors into the Tutte polynomials of its components.
Verify this property with the disjoint union of two copies of the input graph.
N)r   r   disjoint_unionr   simplifyr   )r
   t_gHt_hs       r   test_tutte_polynomial_disjointr       sV    
 

a
 C
!A


a
 C>>#)$++C0000r   c                 \    [         R                  " U 5      R                  U5      (       d   eg r   )r   chromatic_polynomialr   r	   s     r   test_chromatic_polynomialr   +   s$    ""1%,,X6666r   c                     [         R                  " U 5      n[         R                  " X 5      n[         R                  " U5      n[        R	                  X-  5      R                  U5      (       d   eg)zChromatic polynomial factors into the Chromatic polynomials of its
components. Verify this property with the disjoint union of two copies of
the input graph.
N)r   r   r   r   r   r   )r
   x_gr   x_hs       r   "test_chromatic_polynomial_disjointr!   0   sV     
!
!!
$C
!A

!
!!
$C>>#)$++C0000r   )__doc__pytestnetworkxr   importorskipr   complete_graphcycle_graphdiamond_graph_test_tutte_graphs
path_graph_test_chromatic_graphsmarkparametrizeitemsr   keysr   r   r!    r   r   <module>r1      s   G  G$
 a#aMNN13>	  a#a9NN1@6MM!;  *,>,D,D,FG3 H3 055781 91 *,B,H,H,JK7 L7 499;<1 =1r   