ó
 ,µ[c           @   s>   d  Z  d d l Z d d l m Z d g Z d Z d „  Z d S(   s   
Ramsey numbers.
iÿÿÿÿNi   (   t   arbitrary_elementt	   ramsey_R2s)   Nicholas Mancuso (nick.mancuso@gmail.com)c         C   sÊ   |  s t  ƒ  t  ƒ  f St |  ƒ } t j |  | ƒ } t j |  | ƒ } t |  j | ƒ j ƒ  ƒ \ } } t |  j | ƒ j ƒ  ƒ \ } } | j | ƒ | j | ƒ t	 | | d t
 ƒt	 | | d t
 ƒf S(   sü   Approximately computes the Ramsey number `R(2;s,t)` for graph.

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

    Returns
    -------
    max_pair : (set, set) tuple
        Maximum clique, Maximum independent set.
    t   key(   t   setR    t   nxt   all_neighborst   non_neighborsR   t   subgrapht   copyt   addt   maxt   len(   t   Gt   nodet   nbrst   nnbrst   c_1t   i_1t   c_2t   i_2(    (    sG   lib/python2.7/site-packages/networkx/algorithms/approximation/ramsey.pyR      s    !!(   t   __doc__t   networkxR   t   utilsR    t   __all__t
   __author__R   (    (    (    sG   lib/python2.7/site-packages/networkx/algorithms/approximation/ramsey.pyt   <module>   s
   	