§
    bŠtj(	  ã                   óŽ   — d Z ddlZddlmZmZ dgZ ed¦  «         ed¦  «        ej        dd„¦   «         ¦   «         ¦   «         ZdS )	z=
Algorithm to find a maximal (not maximum) independent set.

é    N)Únot_implemented_forÚpy_random_stateÚmaximal_independent_setÚdirectedé   c                 óæ  ‡ — |s$|                      t          ‰ ¦  «        ¦  «        h}nt          |¦  «        }|                     ‰ ¦  «        st	          j        |› d�¦  «        ‚t          j        ˆ fd„|D ¦   «         Ž }t                               ||¦  «        rt	          j        |› d�¦  «        ‚t          |¦  «        }t          ‰                      ¦   «         ¦  «         	                    |                     |¦  «        ¦  «        }|rj|                      t          |¦  «        ¦  «        }| 
                    |¦  «         |                     t          ‰ j        |         ¦  «        |gz   ¦  «         |°j|S )a'  Returns a random maximal independent set guaranteed to contain
    a given set of nodes.

    An independent set is a set of nodes such that the subgraph
    of G induced by these nodes contains no edges. A maximal
    independent set is an independent set such that it is not possible
    to add a new node and still get an independent set.

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

    nodes : list or iterable
       Nodes that must be part of the independent set. This set of nodes
       must be independent.

    seed : integer, random_state, or None (default)
        Indicator of random number generation state.
        See :ref:`Randomness<randomness>`.

    Returns
    -------
    indep_nodes : list
       List of nodes that are part of a maximal independent set.

    Raises
    ------
    NetworkXUnfeasible
       If the nodes in the provided list are not part of the graph or
       do not form an independent set, an exception is raised.

    NetworkXNotImplemented
        If `G` is directed.

    Examples
    --------
    >>> G = nx.path_graph(5)
    >>> nx.maximal_independent_set(G)  # doctest: +SKIP
    [4, 0, 2]
    >>> nx.maximal_independent_set(G, [1])  # doctest: +SKIP
    [1, 3]

    Notes
    -----
    This algorithm does not solve the maximum independent set problem.

    z" is not a subset of the nodes of Gc                 óD   •— g | ]}t          ‰j        |         ¦  «        ‘ŒS © )ÚsetÚadj)Ú.0ÚvÚGs     €úU/var/www/html/CA-Chatbot/venv/lib/python3.11/site-packages/networkx/algorithms/mis.pyú
<listcomp>z+maximal_independent_set.<locals>.<listcomp>E   s%   ø€ Ð9Ð9Ð9¨a�C ¤ a¤™MœMÐ9Ð9Ð9ó    z is not an independent set of G)ÚchoiceÚlistr   ÚissubsetÚnxÚNetworkXUnfeasibleÚunionÚintersectionÚnodesÚ
differenceÚappendÚdifference_updater   )r   r   ÚseedÚ	neighborsÚindep_nodesÚavailable_nodesÚnodes   `      r   r   r      sb  ø€ ðf ð Ø—’�T !™WœWÑ%Ô%Ð&ˆˆå�E‘
”
ˆØ�>Š>˜!ÑÔð RÝÔ# uÐ$PÐ$PÐ$PÑQÔQÐQÝ”	Ð9Ð9Ð9Ð9°5Ð9Ñ9Ô9Ð:€IÝ
×Ò˜	 5Ñ)Ô)ð OÝÔ# uÐ$MÐ$MÐ$MÑNÔNÐNÝ�u‘+”+€KÝ˜!Ÿ'š'™)œ)‘n”n×/Ò/°	·²ÀÑ0FÔ0FÑGÔG€OØ
ð FØ�{Š{�4 Ñ0Ô0Ñ1Ô1ˆØ×Ò˜4Ñ Ô Ð Ø×)Ò)­$¨q¬u°T¬{Ñ*;Ô*;¸t¸fÑ*DÑEÔEÐEð ð Fð Ðr   )NN)	Ú__doc__Únetworkxr   Únetworkx.utilsr   r   Ú__all__Ú_dispatchabler   r
   r   r   ú<module>r(      s–   ððð ð
 Ð Ð Ð Ø ?Ð ?Ð ?Ð ?Ð ?Ð ?Ð ?Ð ?à$Ð
%€ð Ð�ZÑ Ô Ø€�ÑÔØÔð?ð ?ð ?ñ Ôñ Ôñ !Ô ð?ð ?ð ?r   