U
    -e;                     @   sF   d Z ddlZddlmZ ddlmZ dgZededd	d ZdS )
z
Ramsey numbers.
    N)not_implemented_for   )arbitrary_element	ramsey_R2ZdirectedZ
multigraphc                    s   | st  t  fS t|   fddt|  D }t|  }t| | \}}t| | \}}|  |  t	||t
dt	||t
dfS )aH  Compute the largest clique and largest independent set in `G`.

    This can be used to estimate bounds for the 2-color
    Ramsey number `R(2;s,t)` for `G`.

    This is a recursive implementation which could run into trouble
    for large recursions. Note that self-loop edges are ignored.

    Parameters
    ----------
    G : NetworkX graph
        Undirected graph

    Returns
    -------
    max_pair : (set, set) tuple
        Maximum clique, Maximum independent set.

    Raises
    ------
    NetworkXNotImplemented
        If the graph is directed or is a multigraph.
    c                 3   s   | ]}| kr|V  qd S )N ).0Znbrnoder   i/var/www/html/Darija-Ai-Train/env/lib/python3.8/site-packages/networkx/algorithms/approximation/ramsey.py	<genexpr>*   s      zramsey_R2.<locals>.<genexpr>)key)setr   nxZall_neighborsZnon_neighborsr   Zsubgraphcopyaddmaxlen)GZnbrsZnnbrsZc_1Zi_1Zc_2Zi_2r   r   r
   r      s    

)	__doc__Znetworkxr   Znetworkx.utilsr   utilsr   __all__r   r   r   r   r
   <module>   s   