+
    �°³j
  ã                   ó*   € R t ^ RIHt  ! R R4      tR# )z
Union-find data structure.
)Úgroupsc                   óF   a € ] tR t^t o RtR	R ltR tR tR tR t	Rt
V tR# )
Ú	UnionFindaP  Union-find data structure.

Each unionFind instance X maintains a family of disjoint sets of
hashable objects, supporting the following two methods:

- X[item] returns a name for the set containing the given item.
  Each set is named by an arbitrarily-chosen one of its members; as
  long as the set remains unchanged it will keep the same name. If
  the item is not yet part of a set in X, a new singleton set is
  created for it.

- X.union(item1, item2, ...) merges the sets containing each item
  into a single larger set.  If any item is not yet part of a set
  in X, it is added to X as one of the members of the merged set.

  Union-find data structure. Based on Josiah Carlson's code,
  https://code.activestate.com/recipes/215912/
  with significant additional changes by D. Eppstein.
  http://www.ics.uci.edu/~eppstein/PADS/UnionFind.py

Nc                óz   € Vf   Rp/ V n         / V n        V F   p^V P                  V&   W P                   V&   K"  	  R# )z¦Create a new empty union-find structure.

If *elements* is an iterable, this structure will be initialized
with the discrete partition on the given set of elements.

N© ©ÚparentsÚweights)ÚselfÚelementsÚxs   && ÚZ/home/luca/screen-checking/.venv/lib/python3.14/site-packages/networkx/utils/union_find.pyÚ__init__ÚUnionFind.__init__   s?   € ð ÒØˆHØˆŒØˆŒÛˆAØˆD�L‰L˜‰OØ�L‰L˜‹Oó ó    c                ó  € WP                   9  d    WP                   V&   ^V P                  V&   V# . pV P                   V,          pW18w  d)   VP                  V4       TpV P                   V,          pK.  V F  pW0P                   V&   K  	  V# )z:Find and return the name of the set containing the object.)r   r	   Úappend)r
   ÚobjectÚpathÚrootÚancestors   &&   r   Ú__getitem__ÚUnionFind.__getitem__.   sƒ   € ð Ÿ™Ô%Ø#)�L‰L˜Ñ Ø#$ˆD�L‰L˜Ñ ØˆMð ˆØ�|‰|˜FÕ#ˆØŒnØ�K‰K˜ÔØˆFØ—<‘< Õ'ŠDó ˆHØ%)�L‰L˜Ó"ñ àˆr   c                ó,   € \        V P                  4      # )zBIterate through all items ever found or unioned by this structure.)Úiterr   )r
   s   &r   Ú__iter__ÚUnionFind.__iter__D   s   € ä�D—L‘LÓ!Ð!r   c              #  óž   "  € V P                    F  pW,          pK  	  \        V P                   4      P                  4        Rj  x€L
  R#  L5i)a  Iterates over the sets stored in this structure.

For example::

    >>> partition = UnionFind("xyz")
    >>> sorted(map(sorted, partition.to_sets()))
    [['x'], ['y'], ['z']]
    >>> partition.union("x", "y")
    >>> sorted(map(sorted, partition.to_sets()))
    [['x', 'y'], ['z']]

N)r   r   Úvalues)r
   r   Ú_s   &  r   Úto_setsÚUnionFind.to_setsH   s9   é € ð —”ˆAØ•ŠAñ ô ˜$Ÿ,™,Ó'×.Ñ.Ó0×0Ô0ùs   ‚AAÁAÁAc           	     óB  a € \        \        V Uu0 uF  pS V,          kK  	  upV 3R lRR7      4      p \        V4      pT FB  pS P                  T;;,          S P                  T,          ,          uu&   TS P
                  T&   KD  	  R# u upi   \         d     R# i ; i)z8Find the sets containing the objects and merge them all.c                 ó*   <€ SP                   V ,          # ©N)r	   )Úrr
   s   &€r   Ú<lambda>Ú!UnionFind.union.<locals>.<lambda>`   s   ø€ ¸$¿,¹,Àq¾/r   T)ÚkeyÚreverseN)r   ÚsortedÚnextÚStopIterationr	   r   )r
   Úobjectsr   Úrootsr   r%   s   f*    r   ÚunionÚUnionFind.union[   s‘   ø€ ô ÜÙ")Ó*¡'˜Q��a—�¡'Ñ*Ô0IÐSWôó
ˆð
	Ü˜“;ˆDó ˆAØ�L‰L˜× $§,¡,¨q¥/Õ1ÓØ"ˆD�L‰L˜‹Oó ùò +øô
 ô 	Úð	ús   �B
µB ÂBÂBr   r$   )Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r   r   r   r    r/   Ú__static_attributes__Ú__classdictcell__)Ú__classdict__s   @r   r   r      s(   ø‡ € ñô, òò,"ò1÷&#ð #r   r   N)r5   Únetworkx.utilsr   r   r   r   r   Ú<module>r:      s   ðñõ "÷b#ó b#r   