
    \MhN                         d Z ddlZddlmZ ddlmZ dgZ ed           ed          ej        d	                                     Z	dS )
z
Ramsey numbers.
    N)not_implemented_for   )arbitrary_element	ramsey_R2directed
multigraphc                 V   | st                      t                      fS t          |           fdt          j        |           D             }t          j        |           }t          |                     |                                                    \  }}t          |                     |                                                    \  }}|                               |                               t          ||t                    t          ||t                    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   (   K   | ]}|k    |V  d S )N ).0nbrnodes     h/var/www/html/test/jupyter/venv/lib/python3.11/site-packages/networkx/algorithms/approximation/ramsey.py	<genexpr>zramsey_R2.<locals>.<genexpr>,   s'      DDCtCDD    )key)setr   nxall_neighborsnon_neighborsr   subgraphcopyaddmaxlen)Gnbrsnnbrsc_1i_1c_2i_2r   s          @r   r   r      s    6  uucee|QDDDDD2+At44DDDDQ%%ED))..0011HCE**//1122HCGGDMMMGGDMMM sCS!!!3sCS#9#9#999r   )
__doc__networkxr   networkx.utilsr   utilsr   __all___dispatchabler   r   r   r   <module>r)      s         . . . . . . & & & & & &- Z  \""%: %:  #" ! %: %: %:r   