+
    �°³j‡  ã                   ó|   € R t ^ RIt^ RIHtHt R.t]! R4      ]! ^4      ]P                  RR l4       4       4       tR# )z=
Algorithm to find a maximal (not maximum) independent set.

N)Únot_implemented_forÚpy_random_stateÚmaximal_independent_setÚdirectedc           	     ó  € V'       g   VP                  \        V 4      4      0pM\        V4      pVP                  V 4      '       g   \        P
                  ! V R24      h\        P                  ! V Uu. uF  p\        V P                  V,          4      NK!  	  up!  p\        P                  WA4      '       d   \        P
                  ! V R24      h\        V4      p\        V P                  4       4      P                  VP                  V4      4      pV'       da   VP                  \        V4      4      pVP                  V4       VP                  \        V P                  V,          4      V.,           4       Kh  V# u upi )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 : set
   Set 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(4)
>>> sorted(nx.maximal_independent_set(G, seed=1))
[1, 3]

Note that a graph may have many maximal independent sets; for example, the
path graph with 4 nodes has 3 maximal independent sets: ``{0, 2}``,
``{0, 3}`` and ``{1, 3}``.

>>> sorted(nx.maximal_independent_set(G, seed=2))
[0, 2]

This function returns a single maximal independent set. Enumerating *all*
of the maximal independent sets in a graph can be achieved by enumerating the
cliques in the complement graph:

>>> sorted(
...     sorted(c)
...     for c in nx.enumerate_all_cliques(nx.complement(G))
...     if len(c) > 1  # Ignore cliques comprising a single node
... )
[[0, 2], [0, 3], [1, 3]]

Note however that enumerating all cliques is exponential in the number of
nodes in the worst case (e.g. the complete graph).

The `nodes` keyword argument can be used to produce a maximal independent
set that contains the given node(s):

>>> sorted(nx.maximal_independent_set(G, nodes={1}))
[1, 3]

An exception is raised if `nodes` are not independent

>>> nx.maximal_independent_set(G, nodes={1, 2})
Traceback (most recent call last):
   ...
networkx.exception.NetworkXUnfeasible: {1, 2} is not an independent set of G

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

See Also
--------
:func:`~networkx.algorithms.approximation.clique.maximum_independent_set` :
    Algorithm for approximating the maximum independent set, i.e. a
    maximal independent set of maximum cardinality.
z" is not a subset of the nodes of Gz is not an independent set of G)ÚchoiceÚlistÚsetÚissubsetÚnxÚNetworkXUnfeasibleÚunionÚadjÚintersectionÚnodesÚ
differenceÚaddÚdifference_update)ÚGr   ÚseedÚvÚ	neighborsÚindep_nodesÚavailable_nodesÚnodes   &&&     ÚX/home/luca/screen-checking/.venv/lib/python3.14/site-packages/networkx/algorithms/mis.pyr   r      s  € ÷p Ø—‘œT !›WÓ%Ð&‰ä�E“
ˆØ�>‰>˜!×ÒÜ×#Ò# u gÐ-OÐ$PÓQÐQÜ—	’	±5Ó9±5¨aœC §¡ a¥žM±5Ñ9Ñ:€IÜ
×Ñ˜	×)Ò)Ü×#Ò# u gÐ-LÐ$MÓNÐNÜ�e“*€KÜ˜!Ÿ'™'›)“n×/Ñ/°	·±ÀÓ0FÓG€Oß
Ø�{‰{œ4 Ó0Ó1ˆØ�‰˜ÔØ×)Ñ)¬$¨q¯u©u°T­{Ó*;¸t¸fÕ*DÖEØÐùò :s   Á4%E>)NN)	Ú__doc__Únetworkxr   Únetworkx.utilsr   r   Ú__all__Ú_dispatchabler   © ó    r   Ú<module>r#      sP   ðñó
 ß ?à$Ð
%€ñ �ZÓ Ù�ÓØ×Ñódó ó ó !òdr"   