+
    �°³jŒ™  ã                   ó$  € R t ^ RIt^ RIt^ RIt. ROt]P                  ! R. RO4      t]P                  ! R. RO4      t]P                  ! R^ R^/RR/R7      R R	 l4       t
]P                  ! R^ R^/RR/R7      R R
 l4       t]P                  ! R^ R^/RR/R7      R R l4       t]P                  ! R^ R^/RR/R7      R R l4       t]P                  ! R^ R^/RR/R7      R R l4       t]P                  ! R^ R^/RR/R7      R R l4       t]P                  ! R^ R^/RR/R7      R R l4       t]P                  ! R^ R^/RR/R7      R R l4       t]P                  ! R^ R^/RR/R7      R R l4       tR tR tR tR tR tR tR tR tR tR tR tR# )!uÈ  
***************
VF2++ Algorithm
***************

An implementation of the VF2++ algorithm [1]_ for Graph Isomorphism testing.

The simplest interface to use this module is to call:

`vf2pp_is_isomorphic`: check whether two graphs are isomorphic.
`vf2pp_isomorphism`: obtain the node isomorphism mapping between two graphs,
if they are isomorphic.
`vf2pp_all_isomorphisms`: generate all possible isomorphism mappings between
two graphs, if isomorphic.

`vf2pp_subgraph_is_isomorphic`: check whether a specified graph
is isomorphic to an induced subgraph of the other graph.
`vf2pp_subgraph_isomorphism`: obtain the node isomorphism mapping between a
specified graph and any induced subgraph of the other graph, if possible.
`vf2pp_all_subgraph_isomorphisms`: generate all possible isomorphism mappings
between the full graph and the specified induced subgraph.

`vf2pp_is_monomorphic`: check whether two graphs are monomorphic. That is, the node
and edge sets of the subgraph are subsets of the full graph's node and edge sets.
`vf2pp_monomorphism`: obtain the node monomorphism mapping from the full graph to
the specified subgraph if possible.
`vf2pp_all_monomorphisms`: generate all possible monomorphism mappings
between the graph and the specified subgraph.

Introduction
------------
The VF2++ algorithm, follows a similar logic to that of VF2, while also
introducing new easy-to-check cutting rules and determining the optimal access
order of nodes. It is also implemented in a non-recursive manner, which saves
both time and space, when compared to its previous counterpart.

An improved node ordering is obtained after taking into consideration both the
degree and the label rarity of each node.
This way we consider the nodes that eliminate the most branches of the possible
mapping search tree, so we can cut out unfruitful branches early in the process.

Warning: The VF2++ paper uses the symbols ``G1`` and ``G2`` for the two graphs of
interest just as the VF2 paper does. But for subgraph functions the first graph
is smaller in VF2++ while the second is smaller for VF2 and for ISMAGS. This
implementation, VF2pp, matches the VF2 and ISMAGS notation with the second
input being no larger than the first. To avoid confusion with the papers we
name the graphs ``FG`` and ``SG`` for full graph and smaller graph. For VF2pp,
``SG`` corresponds to the paper's ``G1`` while ``FG`` corresponds to ``G2``. This
does not matter for the isomorphism functions (where the graphs have the same size).

Examples
--------

Suppose SG and FG are Isomorphic Graphs. Verification is as follows:

Without node labels:

>>> import networkx as nx
>>> SG = nx.path_graph(4)
>>> FG = nx.path_graph(4)
>>> nx.vf2pp_is_isomorphic(FG, SG, node_label=None)
True
>>> map = nx.vf2pp_isomorphism(FG, SG, node_label=None)
>>> map == {1: 1, 2: 2, 0: 0, 3: 3}
True

With node labels:

>>> nx.set_node_attributes(SG, dict(zip(SG, ["blue", "red", "cyan", "pink"])), "label")
>>> nx.set_node_attributes(FG, dict(zip(FG, ["blue", "red", "cyan", "pink"])), "label")
>>> nx.vf2pp_is_isomorphic(FG, SG, node_label="label")
True
>>> map = nx.vf2pp_isomorphism(FG, SG, node_label="label")
>>> map == {1: 1, 2: 2, 0: 0, 3: 3}
True

For subgraph isomorphism we look for induced subgraphs of FG that are
isomorphic to SG. The process is similar to graph isomorphism with a
different function:

>>> SG = nx.path_graph(3)
>>> FG = nx.path_graph(4)
>>> nx.vf2pp_subgraph_is_isomorphic(FG, SG, node_label=None)
True
>>> map = nx.vf2pp_subgraph_isomorphism(FG, SG, node_label=None)
>>> map == {1: 1, 2: 2, 0: 0}
True

With node labels:

>>> nx.set_node_attributes(SG, dict(zip(SG, ["blue", "red", "cyan"])), "label")
>>> nx.set_node_attributes(FG, dict(zip(FG, ["blue", "red", "cyan", "pink"])), "label")
>>> nx.vf2pp_subgraph_is_isomorphic(FG, SG, node_label="label")
True
>>> map = nx.vf2pp_subgraph_isomorphism(FG, SG, node_label="label")
>>> map == {1: 1, 2: 2, 0: 0}
True

For subgraph monomorphism we look for possibly non-induced subgraphs
of FG that are isomorphic to SG. That means we only need a subset of nodes
and edges of the first that map to nodes and edges of the second. But
not all edges in the second graph need to be mapped to, even if that edge
involves two nodes that are mapped to.

A classic example of this is a path graph mapping to a subgraph of a
cycle graph with the same number of nodes. The missing edge in the path
graph means that no subgraph isomorphism exists. But a monomorphism exists
because not all induced edges need to be mapped to.

>>> SG = nx.path_graph(4)
>>> FG = nx.cycle_graph(4)
>>> nx.vf2pp_is_monomorphic(FG, SG, node_label=None)
True
>>> map = nx.vf2pp_monomorphism(FG, SG, node_label=None)
>>> map == {1: 2, 2: 3, 0: 1, 3: 0}
True

With node labels:

>>> nx.set_node_attributes(SG, dict(zip(SG, ["blue", "red", "cyan", "pink"])), "label")
>>> nx.set_node_attributes(FG, dict(zip(FG, ["blue", "red", "cyan", "pink"])), "label")
>>> nx.vf2pp_is_monomorphic(FG, SG, node_label="label")
True
>>> map = nx.vf2pp_monomorphism(FG, SG, node_label="label")
>>> map == {1: 1, 2: 2, 0: 0, 3: 3}
True

References
----------
.. [1] JÃ¼ttner, AlpÃ¡r & Madarasi, PÃ©ter. (2018). "VF2++â€”An improved subgraph
   isomorphism algorithm". Discrete Applied Mathematics. 242.
   https://doi.org/10.1016/j.dam.2018.02.018

NÚ
_GraphInfoÚSGÚFGÚ
_StateInfoÚ
node_labelÚdefault_label)ÚgraphsÚ
node_attrsc           
     óZ   €  \        \        WW#RR7      4      pV#   \         d     R# i ; i)a²  Return an isomorphic mapping between `FG` and `SG` if it exists.

Parameters
----------
FG, SG : NetworkX Graph or MultiGraph instances.
    The two graphs to check for isomorphism.

node_label : str, optional
    The name of the node attribute to be used when comparing nodes.
    The default is ``None``, meaning node attributes are not considered
    in the comparison. Any node that doesn't have the `node_label`
    attribute uses `default_label` instead.

default_label : scalar
    Default value to use when a node doesn't have an attribute
    named `node_label`. Default is ``None``.

Returns
-------
dict or None
    Node mapping if the two graphs are isomorphic. None otherwise.
ÚISO©ÚPTN©ÚnextÚ_all_morphismsÚStopIteration©r   r   r   r   Úmappings   &&&& Úf/home/luca/screen-checking/.venv/lib/python3.14/site-packages/networkx/algorithms/isomorphism/vf2pp.pyÚvf2pp_isomorphismr   ¸   s1   € ð0Ü”~ b¨jÈEÔRÓSˆØˆøÜô Úðúó   ‚ ›*©*c           
     óZ   €  \        \        WW#RR7      4       R#   \         d     R# i ; i)á�  Examines whether SG and FG are isomorphic.

Parameters
----------
FG, SG : NetworkX Graph or MultiGraph instances.
    The two graphs to check for isomorphism.

node_label : str, optional
    The name of the node attribute to be used when comparing nodes.
    The default is ``None``, meaning node attributes are not considered
    in the comparison. Any node that doesn't have the `node_label`
    attribute uses `default_label` instead.

default_label : scalar
    Default value to use when a node doesn't have an attribute
    named `node_label`. Default is ``None``.

Returns
-------
bool
    True if the two graphs are isomorphic, False otherwise.
r   r   TFr   ©r   r   r   r   s   &&&&r   Úvf2pp_is_isomorphicr   ×   ó-   € ð0ÜŒ^˜B JÀ%ÔHÔIÙøÜô Úðúó   ‚ ›*©*c              #  ó>   "  € \        WW#RR7       Rj  x€L
  R#  L5i)a“  Yields all the possible mappings between FG and SG.

Parameters
----------
FG, SG : NetworkX Graph or MultiGraph instances.
    The two graphs to check for isomorphism.

node_label : str, optional
    The name of the node attribute to be used when comparing nodes.
    The default is ``None``, meaning node attributes are not considered
    in the comparison. Any node that doesn't have the `node_label`
    attribute uses `default_label` instead.

default_label : scalar
    Default value to use when a node doesn't have an attribute
    named `node_label`. Default is ``None``.

Yields
------
dict
    Isomorphic mapping between the nodes in `FG` and `SG`.
r   r   N©r   r   s   &&&&r   Úvf2pp_all_isomorphismsr   ö   ó   é € ô0 ˜b jÀEÔJ×JÔJùó   ‚”•c           
     óZ   €  \        \        WW#RR7      4      pV#   \         d     R# i ; i)aç  Return an isomorphic mapping between nodes of `FG` and `SG` if it exists.

Parameters
----------
FG, SG : NetworkX Graph or MultiGraph instances.
    The two graphs to check for isomorphism.

node_label : str, optional
    The name of the node attribute to be used when comparing nodes.
    The default is ``None``, meaning node attributes are not considered
    in the comparison. Any node that doesn't have the `node_label`
    attribute uses `default_label` instead.

default_label : scalar
    Default value to use when a node doesn't have an attribute
    named `node_label`. Default is ``None``.

Returns
-------
dict or None
    Isomorphism mapping nodes of one graph to nodes of the other.
    If not subgraph isomorphic, return None.
ÚINDr   Nr   r   s   &&&& r   Úvf2pp_subgraph_isomorphismr$     s1   € ð2Ü”~ b¨jÈEÔRÓSˆØˆøÜô Úðúr   c           
     óZ   €  \        \        WW#RR7      4       R#   \         d     R# i ; i)r   r#   r   TFr   r   s   &&&&r   Úvf2pp_subgraph_is_isomorphicr&   1  r   r   c              #  ó>   "  € \        WW#RR7       Rj  x€L
  R#  L5i)aµ  Yields all the possible subgraph isomorphisms between FG and SG.

Parameters
----------
FG, SG : NetworkX Graph or MultiGraph instances.
    The two graphs to check for subgraph isomorphisms.

node_label : str, optional
    The name of the node attribute to be used when comparing nodes.
    The default is ``None``, meaning node attributes are not considered
    in the comparison. Any node that doesn't have the `node_label`
    attribute uses `default_label` instead.

default_label : scalar
    Default value to use when a node doesn't have an attribute
    named `node_label`. Default is ``None``.

Yields
------
dict
    Subgraph isomorphisms mapping the nodes in `SG` to nodes in `FG`.
r#   r   Nr   r   s   &&&&r   Úvf2pp_all_subgraph_isomorphismsr(   P  r    r!   c           
     óZ   €  \        \        WW#RR7      4      pV#   \         d     R# i ; i)a³  Return a monomorphic mapping between `FG` and `SG` if it exists.

Parameters
----------
FG, SG : NetworkX Graph or MultiGraph instances.
    The two graphs to check for monomorphism.

node_label : str, optional
    The name of the node attribute to be used when comparing nodes.
    The default is ``None``, meaning node attributes are not considered
    in the comparison. Any node that doesn't have the `node_label`
    attribute uses `default_label` instead.

default_label : scalar
    Default value to use when a node doesn't have an attribute
    named `node_label`. Default is ``None``.

Returns
-------
dict or None
    Node mapping if the two graphs are isomorphic. None otherwise.
ÚMONOr   Nr   r   s   &&&& r   Úvf2pp_monomorphismr+   k  s1   € ð0Ü”~ b¨jÈFÔSÓTˆØˆøÜô Úðúr   c           
     óZ   €  \        \        WW#RR7      4       R#   \         d     R# i ; i)a�  Examines whether SG and FG are monomorphic.

Parameters
----------
FG, SG : NetworkX Graph or MultiGraph instances.
    The two graphs to check for monomorphism.

node_label : str, optional
    The name of the node attribute to be used when comparing nodes.
    The default is ``None``, meaning node attributes are not considered
    in the comparison. Any node that doesn't have the `node_label`
    attribute uses `default_label` instead.

default_label : scalar
    Default value to use when a node doesn't have an attribute
    named `node_label`. Default is ``None``.

Returns
-------
bool
    True if the two graphs are monomorphic, False otherwise.
r*   r   TFr   r   s   &&&&r   Úvf2pp_is_monomorphicr-   Š  s-   € ð0ÜŒ^˜B JÀ&ÔIÔJÙøÜô Úðúr   c              #  ó>   "  € \        WW#RR7       Rj  x€L
  R#  L5i)aô  Yields all the possible monomorphisms between nodes of FG and SG.

A monomorphism is an injective version of an isomorphism. If two nodes in SG
are connected by an edge, the pre-image nodes in FG must also be connected.
But two mapped nodes connected by an edge in FG may not have an edge in SG.
Maintaining both edges and non-edges (an induced subgraph) is provided by
subgraph isomorphism functions.

Parameters
----------
FG, SG : NetworkX Graph or MultiGraph instances.
    The two graphs to check for isomorphism.

node_label : str, optional
    The name of the node attribute to be used when comparing nodes.
    The default is ``None``, meaning node attributes are not considered
    in the comparison. Any node that doesn't have the `node_label`
    attribute uses `default_label` instead.

default_label : scalar
    Default value to use when a node doesn't have an attribute
    named `node_label`. Default is ``None``.

Yields
------
dict
    Isomorphic mapping of the nodes in `FG` to nodes in `SG`.
r*   r   Nr   r   s   &&&&r   Úvf2pp_all_monomorphismsr/   ©  s   é € ô< ˜b jÀFÔK×KÔKùr!   c           
   #   ó„  a!a""  € \        V4      \        V 4      reV^ 8X  g   V^ 8X  d   R# VP                  4       pWpP                  4       8w  d   \        P                  ! R4      hV'       d   \        p\
        p	M\        p\        p	\        WW#V4      w  r«V
w
  o"   rÍp po!S"! WV4      '       g   R# \        P                  P                  V4      p \        ;QJ d.    V!V"3R lVP                  4        4       F  '       g   K   RM#	  RM! V!V"3R lVP                  4        4       4      pT'       d   R# \        T
4      p\        T4       UUu/ uF	  w  ppTTbK  	  pppT^ ,          pY«3pT\!        T! T.TO5!  4      3.pTP"                  pTP$                  p^ pT'       d¿   TR,          w  pp \'        T4      p\-        TTY«4      '       g   K5  \        T4      TP/                  4       ^,
          8X  d   TP1                  4       pTTT&   Tx € Ku  TTT&   TTT&   \3        TTY«4       T^,          pTT,          pT! T.TO5!  p TP5                  T\!        T 4      34       KÆ  R#   \         d     R# i ; iu uppi   \(         dº    YV,
          T\        T4      ,
          8”  d/   T^,          pTT,          pT\!        T! T.TO5!  4      3TR&    EK6  TP+                  4        T'       dS   TR,          ^ ,          pTT,          pTT,          pTP+                  T4       TP+                  T4       T	! TTY«4        EK    R# i ; i5i)é    Fz)SG and FG must have the same directednessc              3   óÆ   <"  € T FV  w  rS\         P                  8H  ;'       d    VS9  ;'       g(    S! \        V4      \        SV,          4      4      '       * x € KX  	  R # 5i©N)ÚoperatorÚeqÚlen)Ú.0ÚlabelÚnodesÚFG_by_labelÚSG_fitss   &  €€r   Ú	<genexpr>Ú!_all_morphisms.<locals>.<genexpr>ð  s_   øé € ð 
ñ !4‘�ð œŸ™Ñ#×@Ð@¨°[Ñ(@÷ @ð @Ùœ3˜u›:¤s¨;°uÕ+=Ó'>Ó?Ô?ô@ã 3ùs   ƒ A!¤A!±0A!TNéÿÿÿÿ)r6   Úis_directedÚnxÚNetworkXErrorÚ_find_candidates_DiÚ_restore_Tinout_DiÚ_find_candidatesÚ_restore_TinoutÚ
_init_infoÚutilsÚgroupsÚanyÚitemsÚKeyErrorÚ_matching_orderÚ	enumerateÚiterr   Úrev_mapr   r   ÚpopÚ_feasibilityÚnumber_of_nodesÚcopyÚ_update_TinoutÚappend)#r   r   r   r   r   ÚN1ÚN2ÚdirectedÚfind_candidatesÚrestore_TinoutÚ
graph_infoÚ
state_infoÚ_Ú	SG_labelsÚ	FG_labelsÚSG_by_labelÚlabels_mismatchÚ
node_orderÚiÚnodeÚorder_indexÚ
start_nodeÚargsÚstackr   rO   Únode_numberÚcurrent_nodeÚcandidate_iterÚ	candidateÚcandÚ
cp_rev_mapÚtmpr:   r;   s#   &&&&&                            @@r   r   r   Ê  s  ùé € Ü�‹W”c˜"“gˆØ	ˆQ„w�"˜”'Ùà�~‰~Ó€HØ—>‘>Ó#Ô#Ü×ÒÐJÓKÐKçÜ-ˆÜ+‰ä*ˆÜ(ˆô (¨°
È2ÓNÑ€JØCMÑ@€GˆQ��1�a I¨q°!°[á�2�?Š?Ùô —(‘(—/‘/ )Ó,€Kðß›#õ 
ð !,× 1Ñ 1Ô 3ó
Ÿ#Ÿ#š#õ 
ð !,× 1Ñ 1Ô 3ó
ó 
ˆ÷ Ùô ! Ó,€JÜ*3°JÔ*?Ô@Ñ*?™w˜q $�4˜’7Ñ*?€KÑ@Ø˜A•€JØÐ#€Dð œ$™¨zÐA¸DÓAÓBÐCÐD€Eà× Ñ €GØ× Ñ €Gð €Kç
Ø',¨R¥yÑ$ˆ�nð	Ü˜^Ó,ˆIô, ˜ i°×HÔHä�7‹|˜r×1Ñ1Ó3°aÕ7Ô7Ø$Ÿ\™\›^�
Ø(4�
˜9Ñ%Ø Ò Ùð %.ˆG�LÑ!Ø!-ˆG�IÑÜ˜<¨°JÔKà˜1ÕˆKØ˜kÕ*ˆDÙ! $Ð.¨Ó.ˆCØ�L‰L˜$¤ S£	Ð*Ô+ÙñW øô) ô Úðüó Aøô$ ô 	à�w˜¤s¨7£|Õ3Ô3Ø˜qÕ �Ø! +Õ.�Ø!¤4©¸Ð(D¸tÓ(DÓ#EÐF��b‘	Ûà�I‰IŒKßà˜R•y •|�Ø)¨$Õ/�à˜t•}�Ø—‘˜DÔ!Ø—‘˜DÔ!Ù˜t T¨:ÔBÛÚð'	üs•   „A'M Á,A#M Ã
I! Ã#I! Ä'I! Ä(M Ä0M ÅI3ÅAM Æ!M Æ.I9 Æ9M ÇBM É!I0É,M É/I0É0	M É9AL=ËM ËL=Ë'AL=Ì5M Ì<L=Ì=M c                 óö  € VR 8X  d   \         P                  M\         P                  pVR8w  d   \         P                  M\         P                  pVP                  4       p\	        VP                  W#R7      4      p\	        V P                  W#R7      4      p	\        P                  P                  V	4      p
V'       d~   \        VP                  VP                  4       UUUUu/ uF  w  w  r¼w  rÞW¼V3bK  	  ppppp\        V P                  V P                  4       UUUUu/ uF  w  w  r¼w  rÞW¼V3bK  	  pppppM*\	        VP                  4      p\	        V P                  4      p\        VVVV VVV	VVV
4
      p/ / pp\        4       \        4       pp\        4       \        4       pp\        VP                  4       4      p\        V P                  4       4      p\        VVVVVVVV4      pVV3# u uppppi u uppppi )r   r*   )ÚdataÚdefault)r4   r5   Úler?   Údictr9   r@   rG   rH   ÚzipÚ	in_degreeÚ
out_degreeÚdegreer   Úsetr   )r   r   r   r   r   r;   Ú	MONO_fitsrX   r^   r_   r:   Únrc   r]   ÚoÚ	SG_degreeÚ	FG_degreer[   r   Úrev_mappingÚT1ÚT1_inÚT2ÚT2_inÚT1_tildeÚT2_tilder\   s   &&&&&                      r   rF   rF   7  s™  € Ø 5œ[Œh�kŠk¬h¯k©k€GØ! Vœ|”—’´·±€IØ�~‰~Ó€Hô �R—X‘X :�XÓEÓF€IÜ�R—X‘X :�XÓEÓF€IÜ—(‘(—/‘/ )Ó,€K÷ Ü58¸¿¹ÀrÇ}Á}Ô5UÖVÑ5U¡>¡6 A©6¨A�Q˜A˜’YÑ5Uˆ	ÓVÜ58¸¿¹ÀrÇ}Á}Ô5UÖVÑ5U¡>¡6 A©6¨A�Q˜A˜’YÑ5Uˆ	ÓVˆ	ä˜Ÿ™“Oˆ	Ü˜Ÿ™“Oˆ	äØØØØ
Ø
ØØØØØó€Jð ˜rˆ[€GÜ“”s“uˆ€BÜ“”s“uˆ€BÜ�2—8‘8“:‹€HÜ�2—8‘8“:‹€HäØ�˜b %¨°2°u¸hó€Jð �zÐ!Ð!ùõ; WùÝVs   Ã!G+
ÄG3
c           
     ó”  aaaa€ V w
   rpoo  rV'       d   SP                  RR7      o\        SP                  4       4      pVP                  4        UUu/ uF  w  rgV\	        V4      bK  	  uppoS Uu/ uF  qˆ^ bK  	  upo. p	V'       Ed¡   \        VV3R lV 4       4      p
V Uu. uF  pSSV,          ,          V
8X  g   K  VNK  	  pp\        VSP                  P                  R7      p\        P                  ! SV4       EF"  pVP                  4       pV'       g   K  \        V3R lV 4       4      pV Uu. uF  pSV,          V8X  g   K  VNK  	  pp\        V3R lV 4       4      pV Uu. uF  pSP                  V,          V8X  g   K  VNK!  	  pp\        VVV3R lR7      pV	P                  V4       SP                  V4       F  pSV;;,          ^,          uu&   K  	  VP                  V4       SSV,          ;;,          ^,          uu&   VP                  V4       EK  	  EK©  V	# u uppi u upi u upi u upi u upi )a  The node ordering as introduced in VF2++.

Notes
-----
Taking into account the structure of the Graph and the node labeling, the
nodes are placed in an order such that, most of the unfruitful/infeasible
branches of the search space can be pruned on high levels, significantly
decreasing the number of visited states. The premise is that, the algorithm
will be able to recognize inconsistencies early, proceeding to go deep into
the search tree only if it's needed.

Returns
-------
node_order: list
    The ordering of the nodes.
T)Úas_viewc              3   óD   <"  € T F  pSSV,          ,          x € K  	  R # 5ir3   © )r7   Úxr^   Úlabel_raritys   & €€r   r<   Ú"_matching_order.<locals>.<genexpr>  s   øé € ÐJ¹\¸˜ i°¥l×3Ò3»\ùs   ƒ )Úkeyc              3   ó6   <"  € T F  pSV,          x € K  	  R # 5ir3   r‰   )r7   r{   Úused_degreess   & €r   r<   rŒ   ˆ  s   øé € Ð%L¹|¸! l°1§o¢o»|ùs   ƒc              3   óJ   <"  € T F  pSP                   V,          x € K  	  R # 5ir3   )rx   )r7   r{   r   s   & €r   r<   rŒ   Œ  s   øé € Ð MÑ7L°! §¡¨1§¢Ó7Lùs   ƒ #c                 ó$   <€ SSV ,          ,          # r3   r‰   )rŠ   r^   r‹   s   &€€r   Ú<lambda>Ú!_matching_order.<locals>.<lambda>‘  s   ø€ °LÀÈ1ÅÖ4Nó    )Úto_undirectedry   r9   rJ   r6   ÚminÚmaxrx   Ú__getitem__r@   Ú
bfs_layersrS   rU   Ú	neighborsÚremoveÚdiscard)r[   r]   rX   r   Únodes_of_FGLabelsÚV1_unorderedr8   r9   rd   rb   Ú
max_rarityr{   Úrarest_nodesÚmax_nodeÚdlevel_nodesÚnodes_to_addÚmax_used_degreeÚmax_used_degree_nodesÚ
max_degreeÚmax_degree_nodesÚ	next_noder   r^   r‹   r�   s   &                    @@@@r   rL   rL   c  s  û€ ð" EOÑA€A€q�B˜˜I q¨!¨QçØ×Ñ dÐÓ+ˆä�r—x‘x“z“?€LØ:K×:QÑ:QÔ:SÔTÑ:S©,¨%�Eœ3˜u›:Ò%Ñ:SÒT€LÙ(*Ó+© ˜!’G©Ñ+€LØ€Jç
ˆ,ÜÕJ¹\ÓJÓJˆ
á#ó
Ù#�! |°I¸aµLÕ'AÀZÑ'O�AˆA‘|ð 	ð 
ô �|¨¯©×)>Ñ)>Ô?ˆäŸMšM¨"¨h×7ˆLØ'×,Ñ,Ó.ˆLß‘,Ü"%Ô%L¹|Ó%LÓ"L�á+ó)Ù+˜!¨|¸A­À/Ñ/Q—A�A™|ð &ð )ô !Ô MÑ7LÓ MÓM�
á4ó$Ù4˜!¸¿	¹	À!½È
Ñ8R—A�AÑ4ð !ð $ô  Ø$Õ*Nô�	ð ×!Ñ! )Ô,ØŸL™L¨Ö3�DØ  ×&¨!Õ+Õ&ñ 4ð ×#Ñ# IÔ.Ø˜Y yÕ1×2°aÕ7Ó2Ø×$Ñ$ Y×/ô+ 8ð. ÐùóE UùÚ+ùò

ùò)ùò$s0   ÁH0Á5H6Â(H;ÃH;Ä;I ÅI Å1IÆIc           
     ó  € Vw
  r4rVrxrYr«Vw  rÍ    r^W€,          W�,          VP                  W 4      pppWp,           Uu. uF  pVV9   g   K  VNK  	  ppV'       dø   V^ ,          pVP                  VV,          ,          P                  4       W¿,          ,          pVVP                  4       ,          pVR,           F,  pVP                  VP                  VV,          ,          4       K.  	  V Uu0 uF>  pV! VVP                  VV4      4      '       g   K$  V! VV
V,          4      '       g   K<  VkK@  	  ppV'       g   V\        P
                  8X  d   V# W¿,           Uu0 uF  pV! VV
V,          4      '       g   K  VkK  	  ppV\        P
                  8X  d   VP                  V4       MVP                  V4       V Uu0 uF&  pV! VVP                  VV4      4      '       g   K$  VkK(  	  ppV# u upi u upi u upi u upi )z6Given node u of SG, finds the candidates of u from FG.ºé   NN)Únumber_of_edgesÚ_adjÚkeysÚintersection_updater4   r5   Údifference_update)Úur[   r\   r;   rz   r]   r   r   ÚSG_lblsÚSG_degÚFG_degr:   r   rO   r…   Úu_labelÚu_degÚu_loopsÚnbrÚcovered_nbrsÚcandsr{   ÚresultÚvs   &&&                     r   rD   rD   Ÿ  sÌ  € ð NXÑJ€G˜˜r¨A°vØ0:Ñ-€G�a˜˜A˜q !Ø%�j¨&­)°R×5GÑ5GÈÓ5M�GˆU€Gà#%¦5Ó;¡5˜C¨C°7©N—C�C¡5€LÐ;ßà˜1�oˆØ—‘˜ �Õ%×*Ñ*Ó,¨{Õ/CÕCˆØ�—‘“Õˆà ×#Ð#ˆCØ×%Ñ% b§g¡g¨g°c­lÕ&;Ö<ñ $ñ
 ó
á�Ù˜ "×"4Ñ"4°Q¸Ó":×;ô ñ �u˜f Q�i×(÷ ˆAÙð 	ð 
÷ �Y¤(§+¡+Ô-ØˆMð $Ö,ÓJÑ,�1±¸¸vÀa½y×0I�QˆQÑ,€EÐJØ”H—K‘KÔØ×!Ñ! (Õ+à×Ñ Ô(ÙÓO™�A¡)¨G°R×5GÑ5GÈÈ1Ó5M×"N�aˆa™€FÐOØ€Mùò7 <ùò
ùò Kùò
 Ps5   ½	G-ÁG-Ã-!G2ÄG2Ä+G2ÅG7Å9G7Æ=!G<Ç#G<c                 ó–  a€ Vw
  or4rVrtr‰p
Vw  r¼    rMWp,          W€,          VP                  W 4      prþW`,           Uu. uF  pVV9   g   K  VNK  	  ppVP                  V ,           Uu. uF  pVV9   g   K  VNK  	  ppV'       g
   V'       EdÉ   V'       d�   V^ ,          pVP                  VV,          ,          P                  4       VP                  4       ,
          pVR,           F,  pVP	                  VP                  VV,          ,          4       K.  	  MDVP                  4       p\        VP                  VV,          ,          4      pVP                  V4       V F,  pVP	                  VP                  VV,          ,          4       K.  	  VP	                  W®,          4       V Uu0 uFˆ  pV! VVP                  VV4      4      '       g   K$  \        ;QJ d/    V3R l\        WùV,          4       4       F  '       d   K   RM$	  RM ! V3R l\        WùV,          4       4       4      '       g   K†  VkKŠ  	  ppV'       g   V\        P                  8X  d   V# \        W®,          4      pV\        P                  8X  d   VP	                  V4       MVP                  V4       V Uu0 uFˆ  pV! VVP                  VV4      4      '       g   K$  \        ;QJ d/    V3R l\        WùV,          4       4       F  '       d   K   RM$	  RM ! V3R l\        WùV,          4       4       4      '       g   K†  VkKŠ  	  ppV# u upi u upi u upi u upi )r1   rª   c              3   ó8   <"  € T F  w  rS! W4      x € K  	  R # 5ir3   r‰   )r7   ÚudÚvdr;   s   &  €r   r<   Ú&_find_candidates_Di.<locals>.<genexpr>ä  s   øé € ÐGÑ1F¡v r‘7˜2—?�?Ó1Fùs   ƒFTc              3   ó0   <"  € T F  pS! V!  x € K  	  R # 5ir3   r‰   )r7   Údsr;   s   & €r   r<   rÁ   ô  s   øé € Ð<Ñ&; ‰w˜Ž|Ó&;ùs   ƒ)r¬   ÚpredÚ_predr®   r¯   rP   ry   r­   r°   Úallru   r4   r5   )r±   r[   r\   rz   r]   r   r   r²   r³   r´   r:   r   rO   r…   rµ   r¶   r·   ÚsuccÚcovered_successorsrÄ   Úcovered_predecessorsrº   r¼   r»   r{   r;   s   &&&                      @r   rB   rB   È  s¦  ø€ ØMWÑJ€GˆY˜2 7¨v¸{Ø0:Ñ-€G�a˜˜A˜q !Ø%�j¨&­)°R×5GÑ5GÈÓ5M�GˆUà+-®5ÓD©5 4°D¸G±OŸ$˜$©5ÐÐDØ-/¯W©W°Q®ZÓK©Z T¸4À7¹?ŸD˜D©ZÐÐKç×1Ð1ßØ% aÕ(ˆDØ—H‘H˜W T�]Õ+×0Ñ0Ó2°W·\±\³^ÕCˆEà*¨2×.Ð.�Ø×)Ñ)¨"¯(©(°7¸4µ=Õ*AÖBò /ð (×+Ñ+Ó-ˆDÜ˜Ÿ™ ¨¥Õ.Ó/ˆEØ×#Ñ# GÔ,ã(ˆDØ×%Ñ% b§g¡g¨g°d­mÕ&<Ö=ñ )ð 	×!Ñ! +Õ"6Ô7ñ ó
á�Ù˜ "×"4Ñ"4°Q¸Ó":×;ô ÷ ‹sÔG´°UÀ1½IÔ1FÓG�s�sŠsÔG´°UÀ1½IÔ1FÓG×G÷ ˆAÙð 	ð 
÷ �Y¤(§+¡+Ô-ØˆMô �Õ$Ó%€EØ”H—K‘KÔØ×!Ñ! (Õ+à×Ñ Ô(ñ óáˆAÙ�W˜b×0Ñ0°°AÓ6×7ô 	
÷ ‹3Ô<¤c¨%¸µÔ&;Ó<�3�3Š3Ô<¤c¨%¸µÔ&;Ó<×<÷ 	
ˆÙð ð ð €MùòS EùÚKùò$
ùò sS   ¾	L7ÁL7Á)	L<Á7L<Æ)!MÇ
MÇ$MÈ+MÈ1MÊ%!MË
MË$MË=+MÌ-Mc                ón   € VP                   p\        WW#4      '       g   R# \        WW#4      '       g   R# R# )a  Given a candidate pair of nodes u and v from SG and FG respectively,
checks if it's feasible to extend the mapping, i.e. if u and v can be matched.

Notes
-----
This function performs all the necessary checking by applying both consistency
and cutting rules.
FT)r   Ú_feasible_node_pairÚ_feasible_look_ahead)Únode1Únode2r[   r\   r   s   &&&& r   rQ   rQ   ù  s4   € ð 
�‰€Bô ˜u¨Z×DÒDÙô   ¨j×EÒEÙár”   c           
      óž	  a aa a!a"€ Vw
  o"rEo o!rg  pVw   r‰r«rÍpS!P                  4       ;'       g    S P                  4       pS!P                  S ,          S P                  S,          pp\        P                  P	                  V Uu/ uF  pVVV,          bK  	  up4      p\        P                  P	                  V Uu/ uF  pVVV,          bK  	  up4      pS"! VP                  4       VP                  4       4      '       g   R # V'       dÂ   S!P                  S ,          S P                  S,          pp\        P                  P	                  V Uu/ uF  pVVV,          bK  	  up4      p\        P                  P	                  V Uu/ uF  pVVV,          bK  	  up4      pS"! VP                  4       VP                  4       4      '       g   R # V'       Edj   VP                  4        EFT  w  ppVV,          pV'       dˆ   \        V!V 3R lV 4       RR7      p\        V V3R lV 4       RR7      p\        ;QJ d)    V"3R l\        VV4       4       F  '       g   K   RM	  R M! V"3R l\        VV4       4       4      '       d    R # S"! \        V	V,          4      \        VV,          4      4      '       g    R # V'       d3   S"! \        V
V,          4      \        VV,          4      4      '       g    R # V\        P                  Jg   EK"  S"! \        VV,          4      \        VV,          4      4      '       d   EKT   R # 	  V'       g   R# X'       Edj   XP                  4        EFT  w  ppVV,          pV'       dˆ   \        V!V 3R lV 4       RR7      p\        V V3R lV 4       RR7      p\        ;QJ d)    V"3R l\        VV4       4       F  '       g   K   RM	  R M! V"3R l\        VV4       4       4      '       d    R # S"! \        V	V,          4      \        VV,          4      4      '       g    R # V'       d3   S"! \        V
V,          4      \        VV,          4      4      '       g    R # V\        P                  Jg   EK"  S"! \        VV,          4      \        VV,          4      4      '       d   EKT   R # 	  R# u upi u upi u upi u upi )	Fc              3   óH   <"  € T F  pSP                  SV4      x € K  	  R # 5ir3   ©r¬   ©r7   rŠ   r   r±   s   & €€r   r<   Ú'_feasible_look_ahead.<locals>.<genexpr>+  ó!   øé € ÐHÁ%¸Q × 2Ñ 2°1°a× 8Ð 8Ã%ùó   ƒ"T)Úreversec              3   óH   <"  € T F  pSP                  SV4      x € K  	  R # 5ir3   rÑ   ©r7   rŠ   r   r¼   s   & €€r   r<   rÓ   ,  rÔ   rÕ   c              3   óB   <"  € T F  w  rS! W4      '       * x € K  	  R # 5ir3   r‰   ©r7   ÚucÚvcr;   s   &  €r   r<   rÓ   -  ó   øé € ÐKÑ9J©v¨r™7 2›?×*Ñ*Ó9Jùó   ƒc              3   óH   <"  € T F  pSP                  SV4      x € K  	  R # 5ir3   rÑ   rÒ   s   & €€r   r<   rÓ   ?  rÔ   rÕ   c              3   óH   <"  € T F  pSP                  SV4      x € K  	  R # 5ir3   rÑ   rØ   s   & €€r   r<   rÓ   @  rÔ   rÕ   c              3   óB   <"  € T F  w  rS! W4      '       * x € K  	  R # 5ir3   r‰   rÚ   s   &  €r   r<   rÓ   A  rÝ   rÞ   )Úis_multigraphr­   r@   rG   rH   r®   rÅ   rJ   ÚsortedrI   ru   r6   r4   rs   )#r±   r¼   r[   r\   rz   rX   r^   r_   r]   r€   r�   r„   r‚   rƒ   r…   Ú
multigraphÚunbrsÚvnbrsr¸   Úu_labels_successorsÚv_labels_successorsÚupredsÚvpredsÚn1Úu_labels_predecessorsÚn2Úv_labels_predecessorsr8   ÚucntsÚvcntsÚupredÚvpredr   r   r;   s#   ff&&                            @@@r   rÌ   rÌ     sƒ  ü€ ØJTÑG€GˆY " b¨)ÀÀ1ÀaØ5?Ñ2€A€qˆe˜r¨(Ø×!Ñ!Ó#×9Ð9 r×'7Ñ'7Ó'9€Jà—7‘7˜1•:˜rŸw™w q�zˆ5€EÜŸ(™(Ÿ/™/É%Ó*PÉ%À3¨3°	¸#µÒ+>É%Ñ*PÓQÐÜŸ(™(Ÿ/™/É%Ó*PÉ%À3¨3°	¸#µÒ+>É%Ñ*PÓQÐáÐ&×+Ñ+Ó-Ð/B×/GÑ/GÓ/I×JÒJÙçØŸ™ !� b§h¡h¨q¥k�ˆÜ "§¡§¡ÉVÓ0TÉVÀr°°Y¸rµ]Ò1BÉVÑ0TÓ UÐÜ "§¡§¡ÉVÓ0TÉVÀr°°Y¸rµ]Ò1BÉVÑ0TÓ UÐñ Ð,×1Ñ1Ó3Ð5J×5OÑ5OÓ5Q×RÒRÙçÐØ/×5Ñ5×7‰LˆE�5Ø'¨Õ.ˆEçô ÕHÁ%ÓHÐRVÔW�ÜÕHÁ%ÓHÐRVÔW�ß“3ÔK¼¸UÀEÔ9JÓK—3—3’3ÔK¼¸UÀEÔ9JÓK×KÒKÚ Ùœ3˜r E�z›?¬C°°Uµ
«O×<Ò<Úß¡¬¨E°E­MÓ(:¼CÀÈÅÓ<N× OÒ OÚØ¤§¡Ö+Ùœs 8¨eÕ#3Ó4´c¸(ÀUÕ:JÓ6K×LÕLÚ ñ! 8÷" Ù÷ ÐØ1×7Ñ7×9‰LˆE�5Ø)¨%Õ0ˆEçÜÕHÁ%ÓHÐRVÔW�ÜÕHÁ%ÓHÐRVÔW�ß“3ÔK¼¸UÀEÔ9JÓK—3—3’3ÔK¼¸UÀEÔ9JÓK×KÒKÚ Ùœ3˜r E�z›?¬C°°Uµ
«O×<Ò<Úß¡¬¨E°E­MÓ(:¼CÀÈÅÓ<N× OÒ OÚØ¤§¡Ö+Ùœs 8¨eÕ#3Ó4´c¸(ÀUÕ:JÓ6K×LÕLÚ ñ :ñ ùòk +QùÚ*Pùò 1UùÚ0Ts   ÂR;Â;S ÅSÆS
c                 óê  a aa	a
aaaaaaa€ Vvpo
rVrtVP                   VP                  uooVP                  4       ;'       g    VP                  4       pVP                  S ,          VP                  S,          uooV'       d(   VP                  S ,          VP                  S,          uooV'       EgG   \
        ;QJ d     VV3R  lS 4       F  '       g   K   RM	  RM! VV3R  lS 4       4      '       d   R# S
\        P                  8X  dE   \
        ;QJ d     VV3R lS 4       F  '       g   K   RM	  RM! VV3R lS 4       4      '       d   R# V'       g   R# \
        ;QJ d     VV3R lS 4       F  '       g   K   RM	  RM! VV3R lS 4       4      '       d   R# S
\        P                  8X  dE   \
        ;QJ d     VV3R lS 4       F  '       g   K   RM	  RM! VV3R lS 4       4      '       d   R# R# VP                  VP                  uoo	\        ;QJ d$    V	V
VVV V3R lS 4       F  '       d   K   RM	  RM! V	V
VVV V3R lS 4       4      '       g   R# S
\        P                  8X  dM   \        ;QJ d$    V	V
VVV V3R lS 4       F  '       d   K   RM	  RM! V	V
VVV V3R lS 4       4      '       g   R# V'       g   R# \        ;QJ d$    V	V
VVV V3R lS 4       F  '       d   K   RM	  RM! V	V
VVV V3R lS 4       4      '       g   R# S
\        P                  8X  dK   \
        ;QJ d#    V	VVV V3R	 lS 4       F  '       g   K   RM	  RM! V	VVV V3R	 lS 4       4      '       d   R# R# )
c              3   óL   <"  € T F  qS9   g   K  SV,          S9  x € K  	  R # 5ir3   r‰   )r7   r{   r   ræ   s   & €€r   r<   Ú&_feasible_node_pair.<locals>.<genexpr>V  s!   øé € ÐF±¨1¸g¹Ô&ˆw�q�z Ö&³ùó   ƒ$�$TFc              3   óL   <"  € T F  qS9   g   K  SV,          S9  x € K  	  R # 5ir3   r‰   )r7   r{   rO   rå   s   & €€r   r<   rõ   Y  s!   øé € ÐJ±E¨qÀ'¹\Ô*�7˜1•: UÖ*³Eùrö   c              3   óL   <"  € T F  qS9   g   K  SV,          S9  x € K  	  R # 5ir3   r‰   )r7   r{   r   rê   s   & €€r   r<   rõ   _  s!   øé € ÐH±¨AÀ¹<Ô'ˆw�q�z Ö'³ùrö   c              3   óL   <"  € T F  qS9   g   K  SV,          S9  x € K  	  R # 5ir3   r‰   )r7   r{   rO   ré   s   & €€r   r<   rõ   b  s!   øé € ÐL±V°ÀG¹|Ô+�7˜1•: VÖ+³Vùrö   c           	   3   óp   <"  € T F+  qS9   g   K  S! S! SV4      S! SSV,          4      4      x € K-  	  R # 5ir3   r‰   ©r7   r{   ÚFGneÚMONO_opÚSGner   r±   r¼   s   & €€€€€€r   r<   rõ   h  s6   øé € ð 
Ù>C¸ÈGÁ|Ô4‰G‘D˜˜A“J¡ Q¨°­
Ó 3×4Ð4»eùó   ƒ6�&6c              3   óp   <"  € T F+  qS9   g   K  S! S! SSV,          4      S! SV4      4      x € K-  	  R # 5ir3   r‰   )r7   r{   rü   rý   rþ   rO   r±   r¼   s   & €€€€€€r   r<   rõ   m  s7   øé € ð ÙBG¸QÐPWÉ<Ô8‘™˜Q ¨¥
Ó+©T°!°Q«Z×8Ð8Ã%ùrÿ   c              3   óp   <"  € T F+  qS9   g   K  S! S! VS4      S! SV,          S4      4      x € K-  	  R # 5ir3   r‰   rû   s   & €€€€€€r   r<   rõ   u  s6   øé € ð 
Ù>D¸ÈWÉÔ4‰G‘D˜˜A“J¡ W¨Q¥Z°Ó 3×4Ð4»fùrÿ   c              3   óh   <"  € T F'  qS9   g   K  S! SV,          S4      S! VS4      8g  x € K)  	  R # 5ir3   r‰   )r7   r{   rü   rþ   rO   r±   r¼   s   & €€€€€r   r<   rõ   z  s.   øé € ÐU¹f¸ÈWÉÔ4‘4˜ �
 AÓ&©$¨q°!«*Ö4»fùs   ƒ2�"2)
r   rO   râ   r­   rÅ   rI   r4   r5   r¬   rÆ   )r±   r¼   r[   r\   r]   rX   r   r   rä   rü   rý   rþ   r   rO   rå   ré   ræ   rê   s   ff&&     @@@@@@@@@r   rË   rË   M  sV  ÿú€ Ø'1Ð$€A€w�˜bØ!×)Ñ)¨:×+=Ñ+=Ð€GˆWØ×!Ñ!Ó#×9Ð9 r×'7Ñ'7Ó'9€JØ—7‘7˜1•:˜rŸw™w q�z€L€Eˆ5ßØŸ™ !� b§h¡h¨q¥kˆˆ�çˆ:ß‹3ÕF±ÓF�3�3Š3ÕF±ÓF×FÒFÙØ”h—k‘kÔ!ß‹sÕJ±EÓJ�s�sŠsÕJ±EÓJ×JÒJÙçÙç‹3ÕH±ÓH�3�3Š3ÕH±ÓH×HÒHÙØ”h—k‘kÔ!ß‹sÕL±VÓL�s�sŠsÕL±VÓL×LÒLÙÙð ×'Ñ'¨×);Ñ);ˆ
ˆˆdß‹s÷ 
ñ 
Ù>Có
�s�sŠs÷ 
ñ 
Ù>Có
÷ 
ò 
ñ Ø”h—k‘kÔ!ß“3÷ ñ ÙBGó—3—3’3÷ ñ ÙBGó÷ ò ñ çÙç‹s÷ 
ñ 
Ù>Dó
�s�sŠs÷ 
ñ 
Ù>Dó
÷ 
ò 
ñ Ø”h—k‘kÔ!ß‹s×UÐU¹fÓU�s�sŠs×UÐU¹fÓU×UÒUÙÙr”   c                ó¨  € Vv rErgpVw  r‰r«rÍrïWp,           Uu0 uF  pVV9  g   K  VkK  	  ppWa,           Uu0 uF  pVV	9  g   K  VkK  	  ppV
P                  V4       VP                  V4       V
P                  V 4       VP                  V4       VP                  V4       VP                  V4       VP                  V 4       VP                  V4       V'       g   R# VP                  V ,           Uu0 uF  pVV9  g   K  VkK  	  ppVP                  V,           Uu0 uF  pVV	9  g   K  VkK  	  ppVP                  V4       VP                  V4       VP                  V 4       VP                  V4       VP                  V4       VP                  V4       VP                  V 4       VP                  V4       R# u upi u upi u upi u upi )a  Updates the Ti/Ti_out (i=1,2) when a new node pair u-v is added to the mapping.

Notes
-----
This function should be called right after the feasibility checks are passed,
and node1 is mapped to node2. The purpose of this function is to avoid brute
force computing of Ti/Ti_out by iterating over all nodes of the graph and
checking which nodes satisfy the necessary conditions. Instead, in every step
of the algorithm we focus exclusively on the two nodes that are being added
to the mapping, incrementally updating Ti/Ti_out.
N)Úupdaterœ   r°   rÄ   )Ú	new_node1Ú	new_node2r[   r\   r]   rX   r   r   r   r   r€   r�   r„   r‚   rƒ   r…   ÚsÚuncovered_successors_SGÚuncovered_successors_FGÚpÚuncovered_preds_SGÚuncovered_preds_FGs   &&&&                  r   rT   rT     s¤  € ð ",Ð€A€q�B˜QØEOÑB€G˜" X°5à*,®-ÓL©- Q¸1ÀGÑ;KŸq˜q©-ÐÐLØ*,®-ÓP©- Q¸1ÀKÑ;OŸq˜q©-ÐÐPð ‡I�IÐ%Ô&Ø‡I�IÐ%Ô&Ø‡J�JˆyÔØ‡J�JˆyÔà×ÑÐ6Ô7Ø×ÑÐ6Ô7Ø×Ñ�YÔØ×Ñ�YÔçÙà%'§W¡W¨YÖ%7ÓLÑ%7 ¸1ÀGÑ;KŸ!˜!Ñ%7ÐÐLØ%'§W¡W¨YÖ%7ÓPÑ%7 ¸1ÀKÑ;OŸ!˜!Ñ%7ÐÐPà	‡L�LÐ#Ô$Ø	‡L�LÐ#Ô$Ø	‡M�M�)ÔØ	‡M�M�)Ôà×ÑÐ1Ô2Ø×ÑÐ1Ô2Ø×Ñ�YÔØ×Ñ�YÖùò9 MùÚPùò  MùÚPs-   ˜	G ¦G ¸	GÁGÃ5	G
ÄG
Ä 	GÄ.Gc                ó  aa€ Vv rErgpVw  oor‰r«rÍRpWp,           F�  pVS9   d   RpVP                  V 4       K  \        ;QJ d%    V3R lW,           4       F  '       g   K   RM	  RM! V3R lW,           4       4      '       d   Km  VP                  V4       V
P                  V4       K‘  	  V'       g   V
P                  V 4       RpWa,           F�  pVS9   d   RpVP                  V4       K  \        ;QJ d%    V3R lWo,           4       F  '       g   K   RM	  RM! V3R lWo,           4       4      '       d   Km  VP                  V4       VP                  V4       K‘  	  V'       g   VP                  V4       R# R# )zYRestores the previous version of Ti/Ti_out when a node pair is deleted
from the mapping.
FTc              3   ó,   <"  € T F	  qS9   x € K  	  R # 5ir3   r‰   )r7   r¸   r   s   & €r   r<   Ú"_restore_Tinout.<locals>.<genexpr>¾  ó   øé € Ð:©\ c˜'–>«\ùó   ƒc              3   ó,   <"  € T F	  qS9   x € K  	  R # 5ir3   r‰   )r7   r¸   rO   s   & €r   r<   r  Î  r  r  N)ÚaddrI   rœ   )Úpopped_node1Úpopped_node2r[   r\   r]   rX   r   r   r€   r�   r„   r‚   rƒ   r…   Úis_addedÚneighborr   rO   s   &&&&            @@r   rE   rE   ­  s(  ù€ ð
 ",Ð€A€q�B˜QØAKÑ>€GˆW�b ¨uà€HØ×$Ð$ˆØ�wÔàˆHØ�F‰F�<Ö ÷ ‹sÔ:¨R®\Ó:�s�sŠsÔ:¨R®\Ó:×:Ò:ÙØ�J‰J�xÔ Ø�L‰L˜Ö"ñ %÷ Ø�‰�\Ô"à€HØ×$Ð$ˆØ�wÔØˆHØ�F‰F�<Ö ç‹sÔ:¨R®\Ó:�s�sŠsÔ:¨R®\Ó:×:Ò:ÙØ�J‰J�xÔ Ø�L‰L˜Ö"ñ %÷ Ø�‰�\Ö"ñ r”   c                 óÊ	  aa€ Vv rErgpVw  oor‰r«rÍR pWp,           EF  pVS9   d   RpV	P                  V 4       K   \        ;QJ d0    V3R lVP                  V,           4       F  '       g   K   RM%	  R M!! V3R lVP                  V,           4       4      '       g   VP                  V4       \        ;QJ d%    V3R lW,           4       F  '       g   K   RM	  R M! V3R lW,           4       4      '       g   V	P                  V4       Wø9  g   Kø  Wù9  g   EK  V
P                  V4       EK  	  VP                  V ,           EF  pVS9   d   RpVP                  V 4       K   \        ;QJ d0    V3R lVP                  V,           4       F  '       g   K   RM%	  R M!! V3R lVP                  V,           4       4      '       g   VP                  V4       \        ;QJ d&    V3R lVV,           4       F  '       g   K   RM	  R M! V3R lVV,           4       4      '       g   V	P                  V4       VV9   d   Kû  VV	9   d   EK  V
P                  V4       EK  	  V'       g   V
P                  V 4       R pWa,           EF  pVS9   d   RpVP                  V4       K   \        ;QJ d0    V3R lVP                  V,           4       F  '       g   K   RM%	  R M!! V3R lVP                  V,           4       4      '       g   VP                  V4       \        ;QJ d%    V3R lWo,           4       F  '       g   K   RM	  R M! V3R lWo,           4       4      '       g   VP                  V4       Wû9  g   Kø  Wü9  g   EK  VP                  V4       EK  	  VP                  V,           EF  pVS9   d   RpVP                  V4       K   \        ;QJ d0    V3R lVP                  V,           4       F  '       g   K   RM%	  R M!! V3R lVP                  V,           4       4      '       g   VP                  V4       \        ;QJ d&    V3R	 lVV,           4       F  '       g   K   RM	  R M! V3R	 lVV,           4       4      '       g   VP                  V4       VV9   d   Kû  VV9   d   EK  VP                  V4       EK  	  V'       g   VP                  V4       R
# R
# )FTc              3   ó,   <"  € T F	  qS9   x € K  	  R # 5ir3   r‰   ©r7   rÄ   r   s   & €r   r<   Ú%_restore_Tinout_Di.<locals>.<genexpr>å  ó   øé € ÐFÑ3E¨4˜w–Ó3Eùr  c              3   ó,   <"  € T F	  qS9   x € K  	  R # 5ir3   r‰   ©r7   rÇ   r   s   & €r   r<   r  è  ó   øé € ÐA±=¨4˜w–³=ùr  c              3   ó,   <"  € T F	  qS9   x € K  	  R # 5ir3   r‰   r  s   & €r   r<   r  ÷  ó   øé € ÐHÑ3G¨4˜w–Ó3Gùr  c              3   ó,   <"  € T F	  qS9   x € K  	  R # 5ir3   r‰   r  s   & €r   r<   r  ú  ó   øé € ÐC±?¨4˜w–³?ùr  c              3   ó,   <"  € T F	  qS9   x € K  	  R # 5ir3   r‰   ©r7   rÄ   rO   s   & €r   r<   r    r  r  c              3   ó,   <"  € T F	  qS9   x € K  	  R # 5ir3   r‰   ©r7   rÇ   rO   s   & €r   r<   r    r  r  c              3   ó,   <"  € T F	  qS9   x € K  	  R # 5ir3   r‰   r%  s   & €r   r<   r    r!  r  c              3   ó,   <"  € T F	  qS9   x € K  	  R # 5ir3   r‰   r'  s   & €r   r<   r     r#  r  N)r  rI   rÄ   rœ   )r  r  r[   r\   r]   rX   r   r   r€   r�   r„   r‚   rƒ   r…   r  Ú	successorÚpredecessorr   rO   s   &&&&             @@r   rC   rC   ×  s:  ù€ à!+Ð€A€q�B˜QØAKÑ>€GˆW�b ¨uà€HØ×%Ñ%ˆ	Ø˜ÔàˆHØ�I‰I�lÖ#÷ “3ÔF°2·7±7¸9Ö3EÓF—3—3’3ÔF°2·7±7¸9Ö3EÓF×FÒFØ—
‘
˜9Ô%ç“3ÔA°2¶=ÓA—3—3’3ÔA°2¶=ÓA×AÒAØ—‘˜iÔ(àÖ"Ø×)Ø—L‘L ×+ñ! &ð$ —w‘w˜|×,Ñ,ˆØ˜'Ô!àˆHØ�F‰F�<Ö ÷ “3ÔH°2·7±7¸;Ö3GÓH—3—3’3ÔH°2·7±7¸;Ö3GÓH×HÒHØ—
‘
˜;Ô'ç“3ÔC°2°k¶?ÓC—3—3’3ÔC°2°k¶?ÓC×CÒCØ—‘˜kÔ*à 2Ö%¨¸×)=Ø—‘˜[×)ñ -÷& Ø�‰�\Ô"à€HØ×%Ñ%ˆ	Ø˜ÔØˆHØ�I‰I�lÖ#ç“3ÔF°2·7±7¸9Ö3EÓF—3—3’3ÔF°2·7±7¸9Ö3EÓF×FÒFØ—
‘
˜9Ô%ç“3ÔA°2¶=ÓA—3—3’3ÔA°2¶=ÓA×AÒAØ—‘˜iÔ(àÖ"Ø×)Ø—L‘L ×+ñ &ð —w‘w˜|×,Ñ,ˆØ˜'Ô!àˆHØ�F‰F�<Ö ÷ “3ÔH°2·7±7¸;Ö3GÓH—3—3’3ÔH°2·7±7¸;Ö3GÓH×HÒHØ—
‘
˜;Ô'ç“3ÔC°2°k¶?ÓC—3—3’3ÔC°2°k¶?ÓC×CÒCØ—‘˜kÔ*à 2Ö%¨¸×)=Ø—‘˜[×)ñ -÷" Ø�‰�\Ö"ñ r”   )	r   r   r   r$   r&   r(   r+   r-   r/   )
r;   rz   rX   r   r   r^   r_   r}   r~   r:   )r   rO   r€   r�   r„   r‚   rƒ   r…   )NN)Ú__doc__Úcollectionsr4   Únetworkxr@   Ú__all__Ú
namedtupler   r   Ú_dispatchabler   r   r   r$   r&   r(   r+   r-   r/   r   rF   rL   rD   rB   rQ   rÌ   rË   rT   rE   rC   r‰   r”   r   Ú<module>r2     sK  ðñEóN Û ã ò
€ð ×#Ò#Øòó€
ð  ×#Ò#Øò	ó€
ð ×Ò˜$  4¨Ð+¸ÀÐ8WÔXóó Yðð< ×Ò˜$  4¨Ð+¸ÀÐ8WÔXóó Yðð< ×Ò˜$  4¨Ð+¸ÀÐ8WÔXóKó YðKð4 ×Ò˜$  4¨Ð+¸ÀÐ8WÔXóó Yðð> ×Ò˜$  4¨Ð+¸ÀÐ8WÔXóó Yðð< ×Ò˜$  4¨Ð+¸ÀÐ8WÔXóKó YðKð4 ×Ò˜$  4¨Ð+¸ÀÐ8WÔXóó Yðð< ×Ò˜$  4¨Ð+¸ÀÐ8WÔXóó Yðð< ×Ò˜$  4¨Ð+¸ÀÐ8WÔXóLó YðLò@jòZ)"òX9òx&òR.òbò,;ò|/òd+ ò\'#ôTP#r”   