
    fi                        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                            de	                                          d             Zej                            de	                                          d             Zej                            de                                          d             Zej                            de                                          d             ZdS )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                 X    t          j        |                               |          sJ d S N)nxtutte_polynomialequalsr	   s     /var/www/development/aibuddy-work/election-extract/venv/lib/python3.11/site-packages/networkx/algorithms/tests/test_polynomials.pytest_tutte_polynomialr      s-    q!!((2222222    r
   c                     t          j        |           }t          j        | |           }t          j        |          }t                              ||z                                |          sJ dS )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       sf    
 
a
 
 C
!QA

a
 
 C>>#)$$++C0000000r   c                 X    t          j        |                               |          sJ d S r   )r   chromatic_polynomialr   r	   s     r   test_chromatic_polynomialr   +   s-    "1%%,,X6666666r   c                     t          j        |           }t          j        | |           }t          j        |          }t                              ||z                                |          sJ dS )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   sf     
!!
$
$C
!QA

!!
$
$C>>#)$$++C000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     G$$
 Ba#BaMBN13B>	  Ba#Ba9BN1@B6BM!;  *,>,D,D,F,FGG3 3 HG3 05577881 1 981 *,B,H,H,J,JKK7 7 LK7 499;;<<1 1 =<1 1 1r   