
    wg                        d Z ddlZddlZ ej                  d      Z ej                  d      d ej                  d      d ej                  d      d	 ej                         d
iZ	 ej                  d      d ej                  d      d ej                  d      d ej                         d ej                  d      diZej                  j                  de	j                               d        Zej                  j                  de	j!                               d        Zej                  j                  dej                               d        Zej                  j                  dej!                               d        Zy)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                 P    t        j                  |       j                  |      sJ y N)nxtutte_polynomialequalsr	   s     o/home/mcse/projects/flask/flask-venv/lib/python3.12/site-packages/networkx/algorithms/tests/test_polynomials.pytest_tutte_polynomialr      s!    q!((222    r
   c                     t        j                  |       }t        j                  | |       }t        j                  |      }t        j	                  ||z        j                  |      sJ y)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       sW    
 

a
 C
!QA


a
 C>>#)$++C000r   c                 P    t        j                  |       j                  |      sJ y r   )r   chromatic_polynomialr   r	   s     r   test_chromatic_polynomialr   +   s!    ""1%,,X666r   c                     t        j                  |       }t        j                  | |       }t        j                  |      }t        j	                  ||z        j                  |      sJ y)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   sW     
!
!!
$C
!QA

!
!!
$C>>#)$++C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$
 Ba#BaMBNN13B>	  Ba#Ba9BNN1@B6BMM!;  *,>,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   