ó
|£*^c           @   sJ   d  Z  d Z d d l Z d d l m Z d g Z e d ƒ d „  ƒ Z d S(   s   
Semiconnectedness.
s&   ysitu <ysitu@users.noreply.github.com>iÿÿÿÿN(   t   not_implemented_fort   is_semiconnectedt
   undirectedc            s€   t  ˆ  ƒ d k r$ t j d ƒ ‚ n  t j ˆ  ƒ s7 t St j ˆ  ƒ ‰  t j ˆ  ƒ } t ‡  f d †  t | d  | d ƒ Dƒ ƒ S(   sT  Return True if the graph is semiconnected, False otherwise.

    A graph is semiconnected if, and only if, for any pair of nodes, either one
    is reachable from the other, or they are mutually reachable.

    Parameters
    ----------
    G : NetworkX graph
        A directed graph.

    Returns
    -------
    semiconnected : bool
        True if the graph is semiconnected, False otherwise.

    Raises
    ------
    NetworkXNotImplemented :
        If the input graph is not directed.

    NetworkXPointlessConcept :
        If the graph is empty.

    Examples
    --------
    >>> G=nx.path_graph(4,create_using=nx.DiGraph())
    >>> print(nx.is_semiconnected(G))
    True
    >>> G=nx.DiGraph([(1, 2), (3, 2)])
    >>> print(nx.is_semiconnected(G))
    False

    See Also
    --------
    is_strongly_connected,
    is_weakly_connected
    i    s-   Connectivity is undefined for the null graph.c         3   s'   |  ] \ } } ˆ  j  | | ƒ Vq d  S(   N(   t   has_edge(   t   .0t   ut   v(   t   G(    s€   /home/gitlab-runner/builds/8480fa44/0/bergerc/fluidmanager-web/art-framework/bin/networkx/algorithms/components/semiconnected.pys	   <genexpr>@   s    iÿÿÿÿi   (	   t   lent   nxt   NetworkXPointlessConceptt   is_weakly_connectedt   Falset   condensationt   topological_sortt   allt   zip(   R   t   path(    (   R   s€   /home/gitlab-runner/builds/8480fa44/0/bergerc/fluidmanager-web/art-framework/bin/networkx/algorithms/components/semiconnected.pyR      s    '(   t   __doc__t
   __author__t   networkxR	   t   networkx.utilsR    t   __all__R   (    (    (    s€   /home/gitlab-runner/builds/8480fa44/0/bergerc/fluidmanager-web/art-framework/bin/networkx/algorithms/components/semiconnected.pyt   <module>   s
   	