
    hN                     ~    S r SSKrSSKJr  SSKJr  S/r\" S5      \" S5      \R                  S	 5       5       5       r	g)
z
Ramsey numbers.
    N)not_implemented_for   )arbitrary_element	ramsey_R2directed
multigraphc                   ^ U (       d  [        5       [        5       4$ [        U 5      mU4S j[        R                  " U T5       5       n[        R                  " U T5      n[        U R                  U5      R                  5       5      u  p4[        U R                  U5      R                  5       5      u  pVUR                  T5        UR                  T5        [        X5[        S9[        XF[        S94$ )a  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   6   >#    U  H  oT:w  d  M
  Uv   M     g 7f)N ).0nbrnodes     Z/var/www/html/env/lib/python3.13/site-packages/networkx/algorithms/approximation/ramsey.py	<genexpr>ramsey_R2.<locals>.<genexpr>,   s     D4CtCC4s   		)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 sS!3sS#999    )
__doc__networkxr   networkx.utilsr   utilsr   __all___dispatchabler   r   r#   r   <module>r*      sP     . &- Z \"%:  # !%:r#   