
    ިsgN                     ~    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	y)
z
Ramsey numbers.
    N)not_implemented_for   )arbitrary_element	ramsey_R2directed
multigraphc                    | st               t               fS t        |       fdt        j                  |       D        }t        j                  |       }t        | j                  |      j                               \  }}t        | j                  |      j                               \  }}|j                         |j                         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   | ]  }|k7  s	|  y w)N ).0nbrnodes     [/var/www/html/venv/lib/python3.12/site-packages/networkx/algorithms/approximation/ramsey.py	<genexpr>zramsey_R2.<locals>.<genexpr>,   s     DCtCDs   
)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 uce|QDD2++At4DDQ%ED)..01HCE*//12HCGGDMGGDM sCS!3sCS#999    )
__doc__networkxr   networkx.utilsr   utilsr   __all___dispatchabler   r   r"   r   <module>r)      sP     . &- Z \"%:  # !%:r"   