§
    bŠtjË  ã                   óz   — d Z ddlZg d¢Zej        d„ ¦   «         Zej        d„ ¦   «         Zej        d„ ¦   «         ZdS )z8
Functions for identifying isolate (degree zero) nodes.
é    N)Ú
is_isolateÚisolatesÚnumber_of_isolatesc                 ó4   — |                       |¦  «        dk    S )a-  Determines whether a node is an isolate.

    An *isolate* is a node with no neighbors (that is, with degree
    zero). For directed graphs, this means no in-neighbors and no
    out-neighbors.

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

    n : node
        A node in `G`.

    Returns
    -------
    is_isolate : bool
       True if and only if `n` has no neighbors.

    Examples
    --------
    >>> G = nx.Graph()
    >>> G.add_edge(1, 2)
    >>> G.add_node(3)
    >>> nx.is_isolate(G, 2)
    False
    >>> nx.is_isolate(G, 3)
    True
    r   ©Údegree)ÚGÚns     úY/var/www/html/CA-Chatbot/venv/lib/python3.11/site-packages/networkx/algorithms/isolate.pyr   r   
   s   € ð< �8Š8�A‰;Œ;˜!ÒÐó    c                 ó>   — d„ |                       ¦   «         D ¦   «         S )až  Iterator over isolates in the graph.

    An *isolate* is a node with no neighbors (that is, with degree
    zero). For directed graphs, this means no in-neighbors and no
    out-neighbors.

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

    Returns
    -------
    iterator
        An iterator over the isolates of `G`.

    Examples
    --------
    To get a list of all isolates of a graph, use the :class:`list`
    constructor:

    >>> G = nx.Graph()
    >>> G.add_edge(1, 2)
    >>> G.add_node(3)
    >>> list(nx.isolates(G))
    [3]

    To remove all isolates in the graph, first create a list of the
    isolates, then use :meth:`Graph.remove_nodes_from`:

    >>> G.remove_nodes_from(list(nx.isolates(G)))
    >>> list(G)
    [1, 2]

    For digraphs, isolates have zero in-degree and zero out_degree:

    >>> G = nx.DiGraph([(0, 1), (1, 2)])
    >>> G.add_node(3)
    >>> list(nx.isolates(G))
    [3]

    c              3   ó,   K  — | ]\  }}|d k    ¯|V — ŒdS )r   N© )Ú.0r
   Úds      r   ú	<genexpr>zisolates.<locals>.<genexpr>V   s*   è è € Ð/Ð/‘$�!�Q¨¨Qª¨ˆA¨¨¨¨Ð/Ð/r   r   ©r	   s    r   r   r   +   s!   € ðV 0Ð/˜!Ÿ(š(™*œ*Ð/Ñ/Ô/Ð/r   c                 óN   — t          d„ t          | ¦  «        D ¦   «         ¦  «        S )a\  Returns the number of isolates in the graph.

    An *isolate* is a node with no neighbors (that is, with degree
    zero). For directed graphs, this means no in-neighbors and no
    out-neighbors.

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

    Returns
    -------
    int
        The number of degree zero nodes in the graph `G`.

    c              3   ó   K  — | ]}d V — ŒdS )é   Nr   )r   Úvs     r   r   z%number_of_isolates.<locals>.<genexpr>k   s"   è è € Ð&Ð&�QˆqÐ&Ð&Ð&Ð&Ð&Ð&r   )Úsumr   r   s    r   r   r   Y   s'   € õ$ Ð&Ð&�( 1™+œ+Ð&Ñ&Ô&Ñ&Ô&Ð&r   )Ú__doc__ÚnetworkxÚnxÚ__all__Ú_dispatchabler   r   r   r   r   r   ú<module>r      s‘   ððð ð Ð Ð Ð à
:Ð
:Ð
:€ð Ôðð ñ Ôðð@ Ôð*0ð *0ñ Ôð*0ðZ Ôð'ð 'ñ Ôð'ð 'ð 'r   