+
    �°³j­  ã                   ó¸  € R t ^ RIHt ^ RIt^ RIHt . ROt]! R4      ]! R4      ]P                  R 4       4       4       t	R t
]P                  R 4       t]P                  R	 4       t]P                  R
 4       t]! R4      ]! R4      ]P                  ! RR7      RR l4       4       4       t]! R4      ]! R4      ]P                  ! RR7      RR l4       4       4       tR# )z;Functions for computing and verifying matchings in a graph.)ÚrepeatN)Únot_implemented_forÚ
multigraphÚdirectedc                óØ   € \        4       p\        4       pV P                  4        FA  pVw  rEWB9  g   K  WR9  g   K  WE8w  g   K  VP                  V4       VP                  V4       KC  	  V# )aI  Find a maximal matching in the graph.

A matching is a subset of edges in which no node occurs more than once.
A maximal matching cannot add more edges and still be a matching.

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

Returns
-------
matching : set
    A maximal matching of the graph.

Examples
--------
>>> G = nx.Graph([(1, 2), (1, 3), (2, 3), (2, 4), (3, 5), (4, 5)])
>>> sorted(nx.maximal_matching(G))
[(1, 2), (3, 5)]

Notes
-----
The algorithm greedily selects a maximal matching M of the graph G
(i.e. no superset of M exists). It runs in $O(|E|)$ time.
)ÚsetÚedgesÚaddÚupdate©ÚGÚmatchingÚnodesÚedgeÚuÚvs   &     Ú]/home/luca/screen-checking/.venv/lib/python3.14/site-packages/networkx/algorithms/matching.pyÚmaximal_matchingr      sW   € ô< ‹u€HÜ‹E€EØ—‘–	ˆð ‰ˆØŽ>˜ažn°¶Ø�L‰L˜ÔØ�L‰L˜Öñ ð €Oó    c                óÐ   € \        4       pV P                  4        FG  pVw  r4WC3V9   g   W!9   d   K  W48X  d   \        P                  ! RV 24      hVP	                  V4       KI  	  V# )a  Converts matching dict format to matching set format

Converts a dictionary representing a matching (as returned by
:func:`max_weight_matching`) to a set representing a matching (as
returned by :func:`maximal_matching`).

In the definition of maximal matching adopted by NetworkX,
self-loops are not allowed, so the provided dictionary is expected
to never have any mapping from a key to itself. However, the
dictionary is expected to have mirrored key/value pairs, for
example, key ``u`` with value ``v`` and key ``v`` with value ``u``.

z%Selfloops cannot appear in matchings )r   ÚitemsÚnxÚNetworkXErrorr	   )r   r   r   r   r   s   &    r   Úmatching_dict_to_setr   <   sc   € ô ‹E€EØ—‘Ö ˆØ‰ˆØˆ6�UŒ?˜dœmÙØŒ6Ü×"Ò"Ð%JÈ4È&Ð#QÓRÐRØ�	‰	�$Žñ !ð €Lr   c                óš  € \        V\        4      '       d   \        V4      p\        4       pV F™  p\	        V4      ^8w  d   \
        P                  ! RV 24      hVw  rEW@9  g   WP9  d   \
        P                  ! RV R24      hWE8X  d    R# V P                  WE4      '       g    R# WB9   g   WR9   d    R# VP                  V4       K›  	  R# )a[  Return True if ``matching`` is a valid matching of ``G``

A *matching* in a graph is a set of edges in which no two distinct
edges share a common endpoint. Each node is incident to at most one
edge in the matching. The edges are said to be independent.

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

matching : dict or set
    A dictionary or set representing a matching. If a dictionary, it
    must have ``matching[u] == v`` and ``matching[v] == u`` for each
    edge ``(u, v)`` in the matching. If a set, it must have elements
    of the form ``(u, v)``, where ``(u, v)`` is an edge in the
    matching.

Returns
-------
bool
    Whether the given set or dictionary represents a valid matching
    in the graph.

Raises
------
NetworkXError
    If the proposed matching has an edge to a node not in G.
    Or if the matching is not a collection of 2-tuple edges.

Examples
--------
>>> G = nx.Graph([(1, 2), (1, 3), (2, 3), (2, 4), (3, 5), (4, 5)])
>>> nx.is_maximal_matching(G, {1: 3, 2: 4})  # using dict to represent matching
True

>>> nx.is_matching(G, {(1, 3), (2, 4)})  # using set to represent matching
True

úmatching has non-2-tuple edge úmatching contains edge ú with node not in GFT©	Ú
isinstanceÚdictr   r   Úlenr   r   Úhas_edger
   r   s   &&    r   Úis_matchingr#   U   s´   € ôR �(œD×!Ò!Ü'¨Ó1ˆä‹E€EÛˆÜˆt‹9˜Œ>Ü×"Ò"Ð%CÀDÀ6Ð#JÓKÐKØ‰ˆØŒ:˜œÜ×"Ò"Ð%<¸T¸FÐBUÐ#VÓWÐWØŒ6ÚØ�z‰z˜!×ÒÚØŒ:˜œÚØ�‰�TÖñ ñ r   c                ód  € \        V\        4      '       d   \        V4      p\        4       p\        4       pV F¼  p\	        V4      ^8w  d   \
        P                  ! RV 24      hVw  rVWP9  g   W`9  d   \
        P                  ! RV R24      hWV8X  d    R# V P                  WV4      '       g    R# WS9   g   Wc9   d    R# VP                  V4       VP                  V4       VP                  We34       K¾  	  V P                   F(  w  rVWV3V9  g   K  WS9  g   K  Wc9  g   K  WV8w  g   K'   R# 	  R# )a  Return True if ``matching`` is a maximal matching of ``G``

A *maximal matching* in a graph is a matching in which adding any
edge would cause the set to no longer be a valid matching.

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

matching : dict or set
    A dictionary or set representing a matching. If a dictionary, it
    must have ``matching[u] == v`` and ``matching[v] == u`` for each
    edge ``(u, v)`` in the matching. If a set, it must have elements
    of the form ``(u, v)``, where ``(u, v)`` is an edge in the
    matching.

Returns
-------
bool
    Whether the given set or dictionary represents a valid maximal
    matching in the graph.

Examples
--------
>>> G = nx.Graph([(1, 2), (1, 3), (2, 3), (3, 4), (3, 5)])
>>> nx.is_maximal_matching(G, {(1, 2), (3, 4)})
True

r   r   r   FT)r   r    r   r   r!   r   r   r"   r
   r	   r   )r   r   r   r   r   r   r   s   &&     r   Úis_maximal_matchingr%   ’   sÿ   € ô> �(œD×!Ò!Ü'¨Ó1ˆä‹E€EÜ‹E€EÛˆÜˆt‹9˜Œ>Ü×"Ò"Ð%CÀDÀ6Ð#JÓKÐKØ‰ˆØŒ:˜œÜ×"Ò"Ð%<¸T¸FÐBUÐ#VÓWÐWØŒ6ÚØ�z‰z˜!×ÒÚØŒ:˜œÚØ�‰�TÔØ�	‰	�$ŒØ�	‰	�1�&Öñ ð$ —”‰ˆØˆ6˜ÖàŽ~ !¦.°Q¶VÚñ	 ñ
 r   c                óÄ  € \        V\        4      '       d   \        V4      p\        4       pV F™  p\	        V4      ^8w  d   \
        P                  ! RV 24      hVw  rEW@9  g   WP9  d   \
        P                  ! RV R24      hWE8X  d    R# V P                  WE4      '       g    R# WB9   g   WR9   d    R# VP                  V4       K›  	  \	        V4      \	        V 4      8H  # )a#  Return True if ``matching`` is a perfect matching for ``G``

A *perfect matching* in a graph is a matching in which exactly one edge
is incident upon each vertex.

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

matching : dict or set
    A dictionary or set representing a matching. If a dictionary, it
    must have ``matching[u] == v`` and ``matching[v] == u`` for each
    edge ``(u, v)`` in the matching. If a set, it must have elements
    of the form ``(u, v)``, where ``(u, v)`` is an edge in the
    matching.

Returns
-------
bool
    Whether the given set or dictionary represents a valid perfect
    matching in the graph.

Examples
--------
>>> G = nx.Graph([(1, 2), (1, 3), (2, 3), (2, 4), (3, 5), (4, 5), (4, 6)])
>>> my_match = {1: 2, 3: 5, 4: 6}
>>> nx.is_perfect_matching(G, my_match)
True

r   r   r   Fr   r   s   &&    r   Úis_perfect_matchingr'   Ð   sÄ   € ô@ �(œD×!Ò!Ü'¨Ó1ˆä‹E€EÛˆÜˆt‹9˜Œ>Ü×"Ò"Ð%CÀDÀ6Ð#JÓKÐKØ‰ˆØŒ:˜œÜ×"Ò"Ð%<¸T¸FÐBUÐ#VÓWÐWØŒ6ÚØ�z‰z˜!×ÒÚØŒ:˜œÚØ�‰�TÖñ ô ˆu‹:œ˜Q›ÑÐr   Úweight)Ú
edge_attrsc                ó.  a€ \        V P                  4      ^ 8X  d   \        V RVR7      # V P                  V^R7      p^\        R V 4       4      ,           o\        P
                  ! 4       pV3R lV 4       pVP                  WAR7       \        VRVR7      # )ae  Compute a minimum-weight maximum-cardinality matching of `G`.

The minimum-weight maximum-cardinality matching is the matching
that has the minimum weight among all maximum-cardinality matchings.

Use the maximum-weight algorithm with edge weights subtracted
from the maximum weight of all edges.

A matching is a subset of edges in which no node occurs more than once.
The weight of a matching is the sum of the weights of its edges.
A maximal matching cannot add more edges and still be a matching.
The cardinality of a matching is the number of matched edges.

This method replaces the edge weights with 1 plus the maximum edge weight
minus the original edge weight.

new_weight = (max_weight + 1) - edge_weight

then runs :func:`max_weight_matching` with the new weights.
The max weight matching with these new weights corresponds
to the min weight matching using the original weights.
Adding 1 to the max edge weight keeps all edge weights positive
and as integers if they started as integers.

Read the documentation of `max_weight_matching` for more information.

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

weight: string, optional (default='weight')
   Edge data key corresponding to the edge weight.
   If key not found, uses 1 as weight.

Returns
-------
matching : set
    A minimal weight matching of the graph.

See Also
--------
max_weight_matching
T)Úmaxcardinalityr(   )ÚdataÚdefaultc              3   ó,   "  € T F
  w   rVx € K  	  R # 5i©N© )Ú.0Ú_Úws   &  r   Ú	<genexpr>Ú&min_weight_matching.<locals>.<genexpr>7  s   é € Ð2©'™w˜q !�«'ùs   ‚c              3   ó@   <"  € T F  w  rq1VSV,
          3x € K  	  R # 5ir/   r0   )r1   r   r   r3   Ú
max_weights   &   €r   r4   r5   9  s   øé € Ð;±7©¨¨a��J •NÕ#³7ùs   ƒ©r(   )r!   r   Úmax_weight_matchingÚmaxr   ÚGraphÚadd_weighted_edges_from)r   r(   ÚG_edgesÚInvGr   r7   s   &&   @r   Úmin_weight_matchingr?     s�   ø€ ô` ˆ1�7‰7ƒ|�qÔÜ" 1°TÀ&ÔIÐIØ�g‰g˜6¨1ˆgÓ-€GØ”SÑ2©'Ó2Ó2Õ2€JÜ�8Š8‹:€DÜ;±7Ó;€EØ× Ñ  Ð Ô6Ü˜t°DÀÔHÐHr   c                óÞ  a aaaaaaaaa a!a"a#a$a%a&a'a(a)a*€  ! R R4      o ! V3R lR4      o\        S 4      o$S$'       g   \        4       # ^ pRpS P                  RR7       F]  w  rVpVP                  S^4      pWV8w  d	   Wƒ8”  d   TpT;'       d.    \	        \        V4      4      P                  R4      ^,          R9   pK_  	  / o(/ o&/ o'\        \        S$S$4      4      o%\        \        S$\        R4      4      4      o"\        \        S$S$4      4      o / o\        \        S$\        V4      4      4      o#/ o!/ o. o)V V#V3R	 lo*VVVV V%V&V'V(V)3	R
 loVV V%V&V'V(3R lp	VV VV V!V"V%V&V'V(V)V*3R lp
VVVVV V!V"V%V&V'V(3R lpVV V"V(3R loVVV V%V&V'V(3R lpV V!V"V#V$V(VV3R lp S&P                  4        S'P                  4        SP                  4        S! F
  pRVn        K  	  SP                  4        . S)R&   S$ F2  pVS(9  g   K  S&P                  S%V,          4      e   K(  S! V^R4       K4  	  ^ p S)'       EdÁ   V'       Eg¸   S)P                  4       pS&S%V,          ,          ^8X  g   Q hS P                  V4       EFw  pVV8X  d   K  S%V,          pS%V,          pVV8X  d   K(  VV3S9  d   S*! VV4      pV^ 8:  d   R;SVV3&   SVV3&   VV3S9   d“   S&P                  V4      f   S! V^V4       Kw  S&P                  V4      ^8X  d+   V	! VV4      pVSJd   V
! VVV4       K¨  V! VV4       ^p EK  S&P                  V4      f   S&V,          ^8X  g   Q h^S&V&   VV3S'V&   Kè  Kê  S&P                  V4      ^8X  d3   SP                  V4      e   XS*! SV,          !  8  d   VV3SV&   EK/  EK2  S&P                  V4      e   EKH  SP                  V4      e   XS*! SV,          !  8  g   EKp  VV3SV&   EKz  	  EKÉ  V'       d   EMFRpR;p;ppS'       g   ^p\        S#P                  4       4      pS P!                  4        F^  pS&P                  S%V,          4      e   K  SP                  V4      f   K4  S*! SV,          !  pVR8X  g
   VV8  g   KQ  Tp^pSV,          pK`  	  S" F’  pS"V,          e   K  S&P                  V4      ^8X  g   K(  SP                  V4      f   K=  S*! SV,          !  pV'       d   V^,          ^ 8X  g   Q hV^,          pM	VR,          pVR8X  g
   VV8  g   K…  Tp^pSV,          pK”  	  S! FL  pS"V,          e   K  S&P                  V4      ^8X  g   K(  VR8X  g   S!V,          V8  g   K?  S!V,          p^pTpKN  	  VR8X  d0   S'       g   Q h^p\#        ^ \        S#P                  4       4      4      pS$ Fk  pS&P                  S%V,          4      ^8X  d   S#V;;,          V,          uu&   K7  S&P                  S%V,          4      ^8X  g   KV  S#V;;,          V,          uu&   Km  	  S! Fj  pS"V,          e   K  S&P                  V4      ^8X  d   S!V;;,          V,          uu&   K=  S&P                  V4      ^8X  g   KU  S!V;;,          V,          uu&   Kl  	  V^8X  d   M V^8X  d?   Vw  ppS&S%V,          ,          ^8X  g   Q hR;SVV3&   SVV3&   S)P%                  V4       EK¿  V^8X  d?   Vw  ppR;SVV3&   SVV3&   S&S%V,          ,          ^8X  g   Q hS)P%                  V4       EK  V^8X  g   EK  V! VR4       EK  S( F  pS(S(V,          ,          V8X  d   K  Q h	  V'       g   Mj\        S!P'                  4       4       FJ  pVS!9  d   K  S"V,          e   K  S&P                  V4      ^8X  g   K1  S!V,          ^ 8X  g   KA  V! VR4       KL  	  EK=  V'       d   V! 4        \)        S(4      # )a  Compute a maximum-weighted matching of G.

A matching is a subset of edges in which no node occurs more than once.
The weight of a matching is the sum of the weights of its edges.
A maximal matching cannot add more edges and still be a matching.
The cardinality of a matching is the number of matched edges.

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

maxcardinality: bool, optional (default=False)
   If maxcardinality is True, compute the maximum-cardinality matching
   with maximum weight among all maximum-cardinality matchings.

weight: string, optional (default='weight')
   Edge data key corresponding to the edge weight.
   If key not found, uses 1 as weight.


Returns
-------
matching : set
    A maximal matching of the graph.

 Examples
--------
>>> G = nx.Graph()
>>> edges = [(1, 2, 6), (1, 3, 2), (2, 3, 1), (2, 4, 7), (3, 5, 9), (4, 5, 3)]
>>> G.add_weighted_edges_from(edges)
>>> sorted(nx.max_weight_matching(G))
[(2, 4), (5, 3)]

Notes
-----
If G has edges with weight attributes the edge data are used as
weight values else the weights are assumed to be 1.

This function takes time O(number_of_nodes ** 3).

If all edge weights are integers, the algorithm uses only integer
computations.  If floating point weights are used, the algorithm
could return a slightly suboptimal matching due to numeric
precision errors.

This method is based on the "blossom" method for finding augmenting
paths and the "primal-dual" method for finding a matching of maximum
weight, both methods invented by Jack Edmonds [1]_.

Bipartite graphs can also be matched using the functions present in
:mod:`networkx.algorithms.bipartite.matching`.

References
----------
.. [1] "Efficient Algorithms for Finding Maximum Matching in Graphs",
   Zvi Galil, ACM Computing Surveys, 1986.
c                   ó   € ] tR tRtRtRtR# )Ú#max_weight_matching.<locals>.NoNodeiŠ  z-Dummy value which is different from any node.r0   N)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__Ú__static_attributes__r0   r   r   ÚNoNoderB   Š  s   † Ý;r   rI   c                   ó:   <a € ] tR tRt o Rt. ROtV3R ltRtV tR# )Ú$max_weight_matching.<locals>.Blossomi�  z7Representation of a non-trivial blossom or sub-blossom.c              3  óÆ   <"  € . V P                   OpV'       dF   VP                  4       p\        VS4      '       d   VP                  VP                   4       KG  Vx € KM  R # 5ir/   )ÚchildsÚpopr   Úextend)ÚselfÚstackÚtÚBlossoms   &  €r   ÚleavesÚ+max_weight_matching.<locals>.Blossom.leavesŸ  sH   øé € Ø"�d—k‘k�NˆEßØ—I‘I“K�Ü˜a ×)Ò)Ø—L‘L §¡Ö*à”Gñ ùs   ƒA!šAA!r0   N)rM   r   Úmybestedges)	rC   rD   rE   rF   rG   Ú	__slots__rT   rH   Ú__classdictcell__)Ú__classdict__rS   s   @€r   rS   rK   �  s   ù‡ € ÙEâ6ˆ	÷	ó 	r   rS   T©r,   Ú'Nc                 óŠ   <€ SV ,          SV,          ,           ^SV ,          V,          P                  S^4      ,          ,
          # )é   )Úget)r   r3   r   Údualvarr(   s   &&€€€r   ÚslackÚ"max_weight_matching.<locals>.slackü  s3   ø€ Ø�q�z˜G A�JÕ&¨¨Q¨q­T°!­W¯[©[¸ÀÓ-CÕ)CÕCÐCr   c                 ó¦  <	€ S	V ,          pS
P                  V 4      f   S
P                  V4      e   Q hV;S
V &   S
V&   Ve   W 3;SV &   SV&   M
R ;SV &   SV&   R ;SV &   SV&   V^8X  dG   \        VS4      '       d"   SP                  VP                  4       4       R # SP	                  V4       R # V^8X  d   SV,          pS! SV,          ^V4       R # R # r/   )r^   r   rO   rT   Úappend)r3   rR   r   ÚbÚbaserS   ÚassignLabelÚbestedgeÚblossombaseÚ	inblossomÚlabelÚ	labeledgeÚmateÚqueues   &&&  €€€€€€€€€r   rf   Ú(max_weight_matching.<locals>.assignLabel  sÔ   ø€ Ø�a�LˆØ�y‰y˜‹|Ò#¨¯	©	°!«Ò(<Ð<Ð<ØÐˆˆa‰�5˜‘8ØŠ=Ø+,¨&Ð0ˆI�a‰L˜9 Qš<à*.Ð.ˆI�a‰L˜9 Q™<Ø$(Ð(ˆ�‰�h˜q‘kØ�Œ6ä˜!˜W×%Ò%Ø—‘˜QŸX™X›ZÖ(à—‘˜Q–Ø�!ŒVð ˜q•>ˆDÙ˜˜T�
 A tÖ,ñ r   c                 óæ  <€ . pSpV SJdØ   SV ,          pSV,          ^,          '       d   SV,          pM®SV,          ^8X  g   Q hVP                  V4       ^SV&   S	V,          f   SV,          S
9  g   Q hSp M^S	V,          ^ ,          S
SV,          ,          8X  g   Q hS	V,          ^ ,          p SV ,          pSV,          ^8X  g   Q hS	V,          ^ ,          p VSJg   KÙ  YrKÝ  V F  p^SV&   K
  	  V# )é   )rc   )r   r3   Úpathre   rd   rI   rh   ri   rj   rk   rl   s   &&   €€€€€€r   ÚscanBlossomÚ(max_weight_matching.<locals>.scanBlossom  só   ø€ àˆØˆØ�v‹oà˜!•ˆAØ�Q�x˜!�|Œ|Ø" 1•~�ØØ˜•8˜q”=Ð �=Ø�K‰K˜ŒNØˆE�!‰Hà˜�|Ò#à" 1•~¨TÔ1Ð1Ð1Ø‘à  •| A•¨$¨{¸1­~Õ*>Ô>Ð>Ð>Ø˜a•L •O�Ø˜a•L�Ø˜Q•x 1”}Ð$�}à˜a•L •O�à˜�Ø’1ãˆAØˆE�!‹Hñ ð ˆr   c                 ó&  <€ SV ,          pSV,          pSV,          pS! 4       pV SV&   R SV&   VSV&   . ;Vn         pW3.;Vn        pWC8w  d‹   VSV&   VP                  V4       VP                  SV,          4       SV,          ^8X  g4   SV,          ^8X  d$   SV,          ^ ,          SSV,          ,          8X  g   Q hSV,          ^ ,          pSV,          pK�  VP                  V4       VP                  4        VP                  4        WS8w  d¢   VSV&   VP                  V4       VP                  SV,          ^,          SV,          ^ ,          34       SV,          ^8X  g4   SV,          ^8X  d$   SV,          ^ ,          SSV,          ,          8X  g   Q hSV,          ^ ,          pSV,          pK§  SV,          ^8X  g   Q h^SV&   SV,          SV&   ^ SV&   VP	                  4        F.  pSSV,          ,          ^8X  d   SP                  V4       VSV&   K0  	  / p	V EF  p\        VS4      '       df   VP                  e   VP                  p
R Vn        MlVP	                  4        UUu. uF&  pSP                  V4       F  q!V8w  g   K  W3NK  	  K(  	  p
ppM)SP                  V4       Uu. uF  q$V8w  g   K  WB3NK  	  p
pV
 Fc  pVw  rÍSV,          V8X  d   YÜrÜSV,          pWæ8w  g   K(  SP                  V4      ^8X  g   K@  Wé9  g   S! WÍ4      S! Wž,          !  8  g   K_  W¹V&   Ke  	  R SV&   EK  	  \        V	P                  4       4      Vn        R pR SV&   VP                   F  pS! V!  pVe
   VX8  g   K  TpTpK  	  VSV&   R # u uppi u upi r/   )rM   r   rc   ÚreverserT   r   rV   Ú	neighborsr^   ÚlistÚvalues)re   r   r3   ÚbbÚbvÚbwrd   rq   ÚedgsÚ
bestedgetoÚnblistÚkÚiÚjÚbjÚ
mybestedgeÚkslackÚmybestslackrS   r   rg   rh   ÚblossomdualÚblossomparentri   rj   rk   rl   rm   r`   s   &&&               €€€€€€€€€€€€r   Ú
addBlossomÚ'max_weight_matching.<locals>.addBlossom?  s\  ø€ Ø�t�_ˆØ�q�\ˆØ�q�\ˆá‹IˆØˆ�A‰Øˆ�aÑØˆ�bÑàÐˆŒ�4Ø˜&˜Ð!ˆŒ�$àŒhà !ˆM˜"ÑØ�K‰K˜ŒOØ�K‰K˜	 "�Ô&Ø˜•9 ”>Ø�b•	˜Q” 9¨R¥=°Õ#3°t¸KÈ½OÕ7LÔ#Lðð ð ˜"•˜aÕ ˆAØ˜1•ŠBà�‰�BŒØ�‰ŒØ�‰ŒàŒhà !ˆM˜"ÑØ�K‰K˜ŒOØ�K‰K˜ 2� qÕ)¨9°R­=¸Õ+;Ð<Ô=Ø˜•9 ”>Ø�b•	˜Q” 9¨R¥=°Õ#3°t¸KÈ½OÕ7LÔ#Lðð ð ˜"•˜aÕ ˆAØ˜1•ŠBà�R�y˜AŒ~Ðˆ~Øˆˆa‰Ø  •}ˆ	�!‰àˆ�A‰à—‘–ˆAØ�Y˜q•\Õ" aÔ'ð —‘˜Q”ØˆI�a‹Lñ ð ˆ
ÜˆBÜ˜"˜g×&Ò&Ø—>‘>Ò-àŸ^™^�Fà%)�B•Nð
 )+¯	©	¬ôÙ(3 1¸Q¿[¹[È¾^¸ÐTUÉvœ˜›¹^™©ð ñ �Fð ,-¯;©;°r¬?ÓF©? aÀA¹gœ'˜2›'©?�ÐFÛ�Ø‘�Ø˜Q•< 1Ô$Ø�qØ˜q•\�à–GØŸ	™	 "›¨Ö*ØÔ.±5¸³;ÁÈ
ÍÑAWÖ3Wà%&˜r“Nñ ð  ˆH�RŒLñ7 ô8 ˜Z×.Ñ.Ó0Ó1ˆŒàˆ
Øˆ�‰Ø—”ˆAÙ˜A‘YˆFØÒ! V¨kÖ%9Ø�
Ø$’ñ	 ð
 !ˆ�‹ùó7ùò Gs   É&NÊNÊ)NÊ6Nc                 óÂ   <€ VVVV	V
VVVVVV3R  lpV! W4      .pV'       d=   VR,          pV F  pVP                  V! WQ4      4        K0  	  VP                  4        KD  R# )c              3   óV  <"  € V P                    FY  pR SV&   \        VS4      '       d;   V'       d   SV,          ^ 8X  d   Vx € K6  VP                  4        F  pVSV&   K
  	  KT  VSV&   K[  	  V'       Egs   SP                  V 4      ^8X  Ed\   SSV ,          ^,          ,          pV P                   P	                  V4      pV^,          '       d    V\        V P                   4      ,          p^pMRpSV ,          w  r7V^ 8w  d±   V^8X  d   V P                  V,          w  r‰MV P                  V^,
          ,          w  r˜R SV&   R SV	&   S! V^V4       R;SW‰3&   SW˜3&   WV,          pV^8X  d   V P                  V,          w  r7MV P                  V^,
          ,          w  rsR;SW73&   SWs3&   WV,          pK·  V P                   V,          p
^;SV&   SV
&   W73;SV&   SV
&   R SV
&   WV,          pV P                   V,          V8w  dë   V P                   V,          pSP                  V4      ^8X  d   WV,          pKK  \        VS4      '       d2   VP                  4        F  pSP                  V4      '       g   K   M	  MTpSP                  V4      '       dQ   SV,          ^8X  g   Q hSV,          V8X  g   Q hR SV&   R SSSV,          ,          &   S! V^SV,          ^ ,          4       WV,          pEK  SP                  V R 4       SP                  V R 4       SP                  V R 4       SV  SV  SV  R # 5i)NTéÿÿÿÿ)rM   r   rT   r^   Úindexr!   r   rN   )rd   ÚendstageÚsr   Ú
entrychildr�   Újstepr3   ÚpÚqr{   rz   rS   Ú	allowedgerf   rg   rh   r†   r‡   ri   rj   rk   rl   s   &&          €€€€€€€€€€€r   Ú_recurseÚ<max_weight_matching.<locals>.expandBlossom.<locals>._recurse¤  så  øé € à—X”X�Ø#'�˜aÑ Ü˜a ×)Ò)ß K°¥N°aÔ$7àœà!"§¡¦˜AØ+,˜I a›Ló ",ð $%�I˜a“Lñ ÷ �H %§)¡)¨A£,°!Õ"3ð ' y°¥|°A¥Õ7�
à—H‘H—N‘N :Ó.�Ø�q—5”5àœ˜QŸX™X›Õ&�AØ‘Eð �Eà  •|‘�Ø˜1”fà ”zØ Ÿw™w q�z™˜˜1à Ÿw™w q¨1¥u�~™˜Ø#�E˜!‘HØ#�E˜!‘HÙ  1 aÔ(à<@Ð@�I˜q˜fÑ%¨	°1°&Ñ(9Ø•J�AØ ”zØ Ÿw™w q�z™˜˜1à Ÿw™w q¨1¥u�~™˜à<@Ð@�I˜q˜fÑ%¨	°1°&Ñ(9Ø•J’Að —X‘X˜a•[�Ø'(Ð(��a‘˜5 ™9Ø01¨vÐ5�	˜!‘˜y¨™}Ø#�˜‘à•
�Ø—h‘h˜q•k ZÔ/ð Ÿ™ !��BØ—y‘y “}¨Ô)ð �
˜Ù Ü! " g×.Ò.Ø!#§¡¦˜AØ$Ÿy™y¨Ÿ|œ|Ù %ò "-ð ˜ð —y‘y —|’|Ø$ Q�x¨1œ}Ð,˜}Ø(¨�|¨rÔ1Ð1Ð1Ø#'˜˜a™Ø7;˜˜d ;¨r¥?Õ3Ñ4Ù# A q¨)°A­,°q­/Ô:Ø•J“Aà�I‰I�a˜ÔØ�M‰M˜!˜TÔ"Ø�L‰L˜˜DÔ!Ø˜aÐ Ø˜A�Ø˜A’ùs&   ƒ.L)²AL)Á6AL)ÃFL)É/L)ÊBL)NrŒ   ©rc   rN   )rd   rŽ   r•   rQ   Útopr�   rS   r”   rf   rg   rh   r†   r‡   ri   rj   rk   rl   s   &&    €€€€€€€€€€€r   ÚexpandBlossomÚ*max_weight_matching.<locals>.expandBlossomž  sY   ø€ ÷[	÷ [	ñD ˜!Ó&Ð'ˆßØ˜•)ˆCÛ�Ø—‘™X aÓ2Ô3Úñ ð —	‘	–ñ r   c                 ó°   <€ VVVV	3R  lpV! W4      .pV'       d;   VR,          pV F  pVP                  V! V!  4        K.  	  VP                  4        KB  R# )c              3   óf  <"  € TpS
V,          V 8w  d   S
V,          pK  \        VS4      '       d   W!3x € V P                  P                  V4      ;r4V^,          '       d    V\        V P                  4      ,          p^pMRpV^ 8w  dª   WE,          pV P                  V,          pV^8X  d   V P                  V,          w  rgMV P                  V^,
          ,          w  rv\        VS4      '       d   W&3x € WE,          pV P                  V,          p\        VS4      '       d   W'3x € VSV&   VSV&   K°  V P                  VR V P                  RV ,           V n        V P                  VR V P                  RV ,           V n        S	V P                  ^ ,          ,          S	V &   S	V ,          V8X  g   Q hR# 5i)é   NrŒ   )r   rM   r�   r!   r   )rd   r   rR   r€   r�   r‘   r3   ÚxrS   rh   r‡   rl   s   &&      €€€€r   r•   Ú=max_weight_matching.<locals>.augmentBlossom.<locals>._recurse  sp  øé € ð ˆAØ Õ" aÔ'Ø! !Õ$’ä˜!˜W×%Ò%Ø�f’à—H‘H—N‘N 1Ó%Ð%ˆAØ�1�uŒuà”S˜Ÿ™“]Õ"�Ø‘ð �à�q”&à•
�Ø—H‘H˜Q•K�Ø˜A”:ØŸ7™7 1�:‘D�A�qàŸ7™7 1 q¥5�>‘D�AÜ˜a ×)Ò)Ø˜&’Là•
�Ø—H‘H˜Q•K�Ü˜a ×)Ò)Ø˜&’Là��Q‘Ø��Q“à—x‘x  �| a§h¡h¨r° lÕ2ˆAŒHØ—g‘g˜a˜b�k A§G¡G¨B¨Q KÕ/ˆAŒGØ(¨¯©°!­Õ5ˆK˜‰NØ˜q•> QÔ&Ð&Ò&ùs   ƒF.F1NrŒ   r—   )
rd   r   r•   rQ   r˜   ÚargsrS   rh   r‡   rl   s
   &&    €€€€r   ÚaugmentBlossomÚ+max_weight_matching.<locals>.augmentBlossom  sU   ø€ ÷)	'ð )	'ñ` ˜!“Ð ˆßØ˜•)ˆCÛ�Ø—‘™X t™_Ô-Úñ ð —	‘	–ñ r   c                 óô  <€ W3W33 Fì  w  r# S
V,          pSV,          ^8X  g   Q hSV,          f   S	V,          S9  g&   SV,          ^ ,          SS	V,          ,          8X  g   Q h\        VS4      '       d	   S! WB4       VSV&   SV,          f   K‰  SV,          ^ ,          pS
V,          pSV,          ^8X  g   Q hSV,          w  r#S	V,          V8X  g   Q h\        VS4      '       d	   S! Wc4       VSV&   Ké  	  R# )r�   N)r   )r   r3   r�   r�   ÚbsrR   ÚbtrS   r¡   rh   ri   rj   rk   rl   s   &&     €€€€€€€r   ÚaugmentMatchingÚ,max_weight_matching.<locals>.augmentMatchingS  sþ   ø€ Ø�V˜a˜VÓ$‰DˆAð Ø˜q•\�Ø˜R•y A”~Ð%�~Ø! "�Ò-°+¸bµ/ÈÔ2MØ˜b•M !Õ$¨¨[¸­_Õ(=Ô=ðð ô ˜b '×*Ò*Ù" 2Ô)à��Q‘à˜R•=Ò(áØ˜b•M !Õ$�Ø˜q•\�Ø˜R•y A”~Ð%�~à  •}‘�à" 2•¨!Ô+Ð+Ð+Ü˜b '×*Ò*Ù" 2Ô)à��Q“ó; %r   c                  óH  <€ S'       d&   \        ^ \        SP                  4       4      ) 4      p M^ p \        SP                  4       4      V ,           ^ 8¼  g   Q h\        S4      ^ 8X  g!   \        SP                  4       4      ^ 8¼  g   Q hSP	                  RR7       EFd  w  rpVP                  S^4      pW8X  d   K!  SV,          SV,          ,           ^V,          ,
          pV.pV.pSVR,          ,          e"   VP                  SVR,          ,          4       K3  SVR,          ,          e"   VP                  SVR,          ,          4       K3  VP                  4        VP                  4        \        Wg4       F$  w  r‰W‰8w  d    MV^SV,          ,          ,          pK&  	  V^ 8¼  g   Q hSP                  V4      V8X  g   SP                  V4      V8X  g   EK=  SV,          V8X  d   SV,          V8X  g   Q hV^ 8X  d   EKe  Q h	  S F#  p
V
S9   d   K  SV
,          V ,           ^ 8X  d   K#  Q h	  S Fp  pSV,          ^ 8”  g   K  \        VP                  4      ^,          ^8X  g   Q hVP                  R,           F#  w  rSV,          V8X  d   SV,          V8X  d   K#  Q h	  Kr  	  R# )é    TrZ   N:r�   Nr]   rŒ   )	r:   Úminrx   r!   r   r^   rc   ru   Úzip)Úvdualoffsetr€   r�   ÚdÚwtr�   Ú	iblossomsÚ	jblossomsÚbir‚   r   rd   r   r†   r‡   r_   Úgnodesrl   r+   r(   s               €€€€€€€€r   ÚverifyOptimumÚ*max_weight_matching.<locals>.verifyOptimumt  s:  ø€ ßô ˜a¤# g§n¡nÓ&6Ó"7Ð!7Ó8‰KàˆKä�7—>‘>Ó#Ó$ {Õ2°aÔ7Ð7Ð7Ü�;Ó 1Ô$¬¨K×,>Ñ,>Ó,@Ó(AÀQÔ(FÐFÐFð —w‘w D�w×)‰GˆA�!Ø—‘�v˜qÓ!ˆBØŒvÙØ˜•
˜W Q�ZÕ'¨!¨b­&Õ0ˆAØ˜ˆIØ˜ˆIØ 	¨"¥Õ.Ò:Ø× Ñ  ¨y¸­}Õ!=Ö>Ø 	¨"¥Õ.Ò:Ø× Ñ  ¨y¸­}Õ!=Ö>Ø×ÑÔØ×ÑÔÜ˜iÖ3‘�Ø”8ÙØ�Q˜ R�Õ(Õ(’ñ 4ð ˜”6ˆM�6Ø�x‰x˜‹{˜aÔ 4§8¡8¨A£;°!×#3Ø˜A•w !”|¨¨Q­°1¬Ð4Ð4Ø˜A—v��vñ) *ó, ˆAØ˜–I '¨!¥*¨{Õ":¸aÖ"?Ð?Ð?ñ ó ˆAØ˜1�~ Ö!Ü˜1Ÿ7™7“| aÕ'¨1Ô,Ð,Ð,ØŸG™G DŸM˜M‘D�AØ �7 aœ<¨D°­G°q®LÐ8Ð8ó *ó r   :NNNg       @F)ÚintÚlongrŒ   )rw   r   r   r^   ÚstrÚtypeÚsplitr    r«   r   ÚclearrV   rN   rv   rª   rx   r   r:   rc   Úkeysr   )+r   r+   r(   Ú	maxweightÚ
allintegerr€   r�   r­   r®   rr   rˆ   r™   r¦   r³   rd   r   Ú	augmentedr3   rz   r{   r„   re   Ú	deltatypeÚdeltaÚ	deltaedgeÚdeltablossomrS   rI   r”   rf   r¡   rg   rh   r†   r‡   r_   r²   ri   rj   rk   rl   rm   r`   s+   fff                       @@@@@@@@@@@@@@@@@r   r9   r9   >  sh  ÿÿû€ ÷X<ñ <÷ô ô8 �!‹W€FßÜ‹uˆð €IØ€JØ—7‘7 �7Ö%‰ˆˆaØ�U‰U�6˜1ÓˆØŒ6�b”nØˆIØ×TÐT¤S¬¨b«£]×%8Ñ%8¸Ó%=¸aÕ%@ÀOÑ%SŠ
ñ	 &ð €Dð €Eð €Iô ”S˜ Ó(Ó)€Iô
 œ˜V¤V¨D£\Ó2Ó3€Mô ”s˜6 6Ó*Ó+€Kð €Hô ”3�vœv iÓ0Ó1Ó2€Gð
 €Kð
 €Ið €E÷D÷
-õ -÷2 ò  ÷J\!÷ \!ð \!÷~o÷ o÷h=ð =÷Bó ÷B)9ô )9ðZ ð 	�‰ŒØ�‰Ôð 	�‰ÔÛˆAØ ˆAŽMñ ð
 	�‰Ôð ˆˆa‰ó ˆAØ˜– 5§9¡9¨Y°q­\Ó#:Ô#BÙ˜A˜q $Ö'ñ ð
 ˆ	Ø÷ �%§	 	à—I‘I“K�Ø˜Y q�\Õ*¨aÔ/Ð/Ð/ð Ÿ™ QŸ�AØ˜A”vÙ à" 1��BØ" 1��BØ˜R”xá Ø˜1�v YÔ.Ù!& q¨!£˜Ø! Qœ;àDHÐH˜I q¨! fÑ-°	¸1¸a¸&Ñ0AØ˜1�v Ô*Ø Ÿ9™9 R›=Ò0ñ (¨¨1¨aÖ0Ø"ŸY™Y r›]¨aÔ/ñ $/¨q°!Ó#4˜DØ#¨6Ó1ñ !+¨4°°AÖ 6ñ !0°°1Ô 5Ø,- 	Û %Ø"ŸY™Y q›\Ò1ð
 $)¨¥9°¤>Ð1 >Ø'(˜E !™HØ,-¨q¨6˜I a›Lñ 2ð Ÿ™ 2›¨!Ô+ð $Ÿ<™<¨Ó+Ò3°vÁÀxÐPRÅ|Ñ@TÔ7TØ,-¨q¨6˜H RœLò 8UàŸ™ 1›Õ-ð $Ÿ<™<¨›?Ò2°f¹uÀhÈqÅkÑ?R×6RØ+,¨a¨&˜H QœKôi (÷l Ùð ˆIØ/3Ð3ˆEÐ3�I ÷ "Ø�	Ü˜GŸN™NÓ,Ó-�ð —W‘W–Y�Ø—9‘9˜Y q�\Ó*Ô2°x·|±|ÀA³Ô7RÙ˜x¨�{Ñ+�AØ  B”¨!¨e®)Ø !˜Ø$%˜	Ø$,¨Q¥Kš	ñ ó #�à! !Õ$Ô,ØŸ	™	 !›¨Ö)Ø Ÿ™ Q›Ô3á" H¨Q¥KÑ0�Fß!Ø &¨¥
¨qÔ0Ð0Ð0Ø" a�K™à" S�L˜Ø  B”¨!¨e®)Ø !˜Ø$%˜	Ø$,¨Q¥Kš	ñ #ó$ !�à! !Õ$Ô,ØŸ	™	 !›¨Ö)Ø" bœ¨K¸­N¸UÖ,Bà'¨�N�EØ !�IØ#$’Lñ !ð ˜BŒ÷ &Ð%�~Ø�	Ü˜Aœs 7§>¡>Ó#3Ó4Ó5�ó �Ø—9‘9˜Y q�\Ó*¨aÔ/à˜A—J %Õ'•JØ—Y‘Y˜y¨�|Ó,°Ö1à˜A—J %Õ'•Jñ ó !�Ø  Õ#Ô+Ø—y‘y “| qÔ(à# AŸ¨%Õ/�ØŸ™ 1›¨Ö*à# AŸ¨%Õ/�ñ !ð ˜AŒ~àØ˜a”à"‘��AØ˜Y q�\Õ*¨aÔ/Ð/Ð/Ø8<Ð<�	˜1˜a˜&Ñ! I¨q°!¨fÑ$5Ø—‘˜Q—Ø˜a”à"‘��AØ8<Ð<�	˜1˜a˜&Ñ! I¨q°!¨fÑ$5Ø˜Y q�\Õ*¨aÔ/Ð/Ð/Ø—‘˜Q—Ø˜a—á˜l¨E×2ó
 ˆAØ˜˜Q�•= AÖ%Ð%Ð%ñ ÷ Øô �k×&Ñ&Ó(Ö)ˆAØ˜Ô#ÙØ˜QÕÔ'¨E¯I©I°a«L¸AÖ,=À+ÈaÅ.ÐTUÖBUÙ˜a Ö&ô	 *÷ ÙŒä Ó%Ð%r   )r#   r%   r'   r9   r?   r   r8   )Fr(   )rG   Ú	itertoolsr   Únetworkxr   Únetworkx.utilsr   Ú__all__Ú_dispatchabler   r   r#   r%   r'   r?   r9   r0   r   r   Ú<module>rÈ      s  ðÙ Aå ã Ý .ò€ñ �\Ó"Ù�ZÓ Ø×Ññ$ó ó !ó #ð$òNð2 ×Ññ9ó ð9ðx ×Ññ:ó ð:ðz ×Ññ0 ó ð0 ñf �\Ó"Ù�ZÓ Ø×Ò˜XÔ&ó4Ió 'ó !ó #ð4Iñn �\Ó"Ù�ZÓ Ø×Ò˜XÔ&ó{&ó 'ó !ó #ò{&r   