
    fi
                     J    d dl Z d dlZ G d d          Z G d d          ZdS )    Nc                   B    e Zd ZdZd Zd Zd Zd Zd Zd Z	d Z
d	 Zd
S )TestMinEdgeCoverz4Tests for :func:`networkx.algorithms.min_edge_cover`c                 x    t          j                    }t          j        |          t                      k    sJ d S N)nxGraphmin_edge_coversetselfGs     /var/www/development/aibuddy-work/election-extract/venv/lib/python3.11/site-packages/networkx/algorithms/tests/test_covering.pytest_empty_graphz!TestMinEdgeCover.test_empty_graph	   s3    HJJ ##suu,,,,,,    c                     t          j                    }|                    dd           t          j        |          dhk    sJ d S )Nr   r   r   )r   r   add_edger	   r   s     r   test_graph_with_loopz%TestMinEdgeCover.test_graph_with_loop   sE    HJJ	

1a ##x//////r   c                     t          j                    }|                    d           t          j        t           j        d          5  t          j        |           d d d            d S # 1 swxY w Y   d S )N   zFGraph has a node with no edge incident on it, so no edge cover exists.)match)r   r   add_nodepytestraisesNetworkXExceptionr	   r   s     r   test_graph_with_isolated_vz+TestMinEdgeCover.test_graph_with_isolated_v   s    HJJ	

1] Z
 
 
 	! 	! a   		! 	! 	! 	! 	! 	! 	! 	! 	! 	! 	! 	! 	! 	! 	! 	! 	! 	!s   	A++A/2A/c                 h    t          j        dg          }t          j        |          dhdhfv sJ d S )Nr   r   r   r   )r   r   r	   r   s     r   test_graph_single_edgez'TestMinEdgeCover.test_graph_single_edge   s>    HfX ##6(';;;;;;;r   c                     t          j        d          }t          j        |          }t          |          dk    sJ |j        D ]\  }}||f|v s||f|v sJ d S )N      )r   
path_graphr	   lenedges)r   r   	min_coveruvs        r   test_graph_two_edge_pathz)TestMinEdgeCover.test_graph_two_edge_path   s{    M!%a((	9~~""""G 	> 	>DAqq6Y&&1a&I*=*=*=*=	> 	>r   c                    t          j                    }|                    g dd           |                    g dd           |                    g d           t          j        |t           j        j        j        j                  }t          j	        ||          sJ t          |          dk    sJ t          j        |          }t          j	        ||          sJ t          |          dk    sJ d S )	N)r   r#   r"      r   )	bipartite)abcr   ))r   r.   )r   r/   )r#   r/   )r#   r0   )r"   r0   )r,   r.      r,   )r   r   add_nodes_fromadd_edges_fromr	   
algorithmsr-   matchingeppstein_matchingis_edge_coverr%   )r   r   r'   
min_cover2s       r   test_bipartite_explicitz(TestMinEdgeCover.test_bipartite_explicit&   s    HJJ	333	A666	UUUVVV%r}&/A
 
	 9-----9~~""""&q))
:.....:!######r   c                     t          j        d          }t          j        |          }t          j        ||          sJ t	          |          dk    sJ d S )N
      r   complete_graphr	   r7   r%   r   r   r'   s      r   test_complete_graph_evenz)TestMinEdgeCover.test_complete_graph_even6   X    b!!%a((	9-----9~~""""""r   c                     t          j        d          }t          j        |          }t          j        ||          sJ t	          |          dk    sJ d S )N      r=   r?   s      r   test_complete_graph_oddz(TestMinEdgeCover.test_complete_graph_odd<   rA   r   N)__name__
__module____qualname____doc__r   r   r   r    r*   r9   r@   rE    r   r   r   r      s        >>- - -0 0 0
! ! !< < <> > >$ $ $ # # ## # # # #r   r   c                   $    e Zd ZdZd Zd Zd ZdS )TestIsEdgeCoverz3Tests for :func:`networkx.algorithms.is_edge_cover`c                 r    t          j                    }t          j        |t                                sJ d S r   )r   r   r7   r
   r   s     r   r   z TestIsEdgeCover.test_empty_graphF   s0    HJJ355)))))))r   c                     t          j                    }|                    dd           t          j        |dh          sJ d S )Nr   r   r   r   r   r   r7   r   s     r   r   z$TestIsEdgeCover.test_graph_with_loopJ   sB    HJJ	

1aF8,,,,,,,r   c                    t          j                    }|                    dd           t          j        |ddh          sJ t          j        |ddh          sJ t          j        |dh          sJ t          j        |dh          rJ d S )Nr   r   r   rO   r   r   rP   r   s     r   r    z&TestIsEdgeCover.test_graph_single_edgeO   s    HJJ	

1aFF#344444FF#344444F8,,,,,#Ax0000000r   N)rF   rG   rH   rI   r   r   r    rJ   r   r   rL   rL   C   sG        ==* * *- - -
1 1 1 1 1r   rL   )r   networkxr   r   rL   rJ   r   r   <module>rS      su        :# :# :# :# :# :# :# :#z1 1 1 1 1 1 1 1 1 1r   