§
    ¹³Ùgq  ã                   óÜ   — d dl mZmZ  ed¦  «        Z G d„ de¦  «        Z G d„ de¦  «        Z G d„ dee         ¦  «        Z G d	„ d
ee         ¦  «        Z G d„ dee         ¦  «        Z	dS )é    )ÚTypeVarÚGenericÚ_Tc                   ó   — e Zd ZdZdS )Ú
StopSearchzStop graph traversalN©Ú__name__Ú
__module__Ú__qualname__Ú__doc__© ó    úE/granary/edev/quantum/lib/python3.11/site-packages/rustworkx/visit.pyr   r      s   € € € € € ØÐà€Dr   r   c                   ó   — e Zd ZdZdS )ÚPruneSearchz7Prune part of the search tree while traversing a graph.Nr   r   r   r   r   r      s   € € € € € ØAÐAà€Dr   r   c                   ó6   — e Zd ZdZd„ Zd„ Zd„ Zd„ Zd„ Zd„ Z	dS )	Ú
BFSVisitorzÒA visitor object that is invoked at the event-points inside the
    :func:`~rustworkx.bfs_search` algorithm. By default, it performs no
    action, and should be used as a base class in order to be useful.
    c                 ó   — dS )zR
        This is invoked when a vertex is encountered for the first time.
        Nr   ©ÚselfÚvs     r   Údiscover_vertexzBFSVisitor.discover_vertex    ó	   € ð 	ˆr   c                 ó   — dS ©z^
        This is invoked on vertex `v` after all of its out edges have been examined.
        Nr   r   s     r   Úfinish_vertexzBFSVisitor.finish_vertex&   r   r   c                 ó   — dS ©zu
        This is invoked on each edge as it becomes a member of the edges
        that form the search tree.
        Nr   ©r   Úes     r   Ú	tree_edgezBFSVisitor.tree_edge,   ó	   € ð
 	ˆr   c                 ó   — dS )z{
        This is invoked on back or cross edges for directed graphs and cross edges
        for undirected graphs.
        Nr   r   s     r   Únon_tree_edgezBFSVisitor.non_tree_edge3   r"   r   c                 ó   — dS )zÕ
        This is invoked on the subset of non-tree edges whose target vertex is
        colored gray at the time of examination.
        The color gray indicates that the vertex is currently in the queue.
        Nr   r   s     r   Úgray_target_edgezBFSVisitor.gray_target_edge:   ó	   € ð 	ˆr   c                 ó   — dS )zÝ
        This is invoked on the subset of non-tree edges whose target vertex is
        colored black at the time of examination.
        The color black indicates that the vertex has been removed from the queue.
        Nr   r   s     r   Úblack_target_edgezBFSVisitor.black_target_edgeB   r'   r   N)
r	   r
   r   r   r   r   r!   r$   r&   r)   r   r   r   r   r      sx   € € € € € ðð ð
ð ð ðð ð ðð ð ðð ð ðð ð ðð ð ð ð r   r   c                   ó0   — e Zd ZdZd„ Zd„ Zd„ Zd„ Zd„ ZdS )Ú
DFSVisitorzÒA visitor object that is invoked at the event-points inside the
    :func:`~rustworkx.dfs_search` algorithm. By default, it performs no
    action, and should be used as a base class in order to be useful.
    c                 ó   — dS )zŽ
        This is invoked when a vertex is encountered for the first time.
        Together we report the discover time of vertex `v`.
        Nr   ©r   r   Úts      r   r   zDFSVisitor.discover_vertexQ   r"   r   c                 ó   — dS )aq  
        This is invoked on vertex `v` after `finish_vertex` has been called for all
        the vertices in the DFS-tree rooted at vertex `v`. If vertex `v` is a leaf in
        the DFS-tree, then the `finish_vertex` function is called on `v` after all
        the out-edges of `v` have been examined. Together we report the finish time
        of vertex `v`.
        Nr   r-   s      r   r   zDFSVisitor.finish_vertexX   s	   € ð 	ˆr   c                 ó   — dS r   r   r   s     r   r!   zDFSVisitor.tree_edgeb   r"   r   c                 ó   — dS )a:  
        This is invoked on the back edges in the graph.
        For an undirected graph there is some ambiguity between tree edges
        and back edges since the edge :math:`(u, v)` and :math:`(v, u)` are the
        same edge, but both the `tree_edge()` and `back_edge()` functions will be
        invoked. One way to resolve this ambiguity is to record the tree edges,
        and then disregard the back-edges that are already marked as tree edges.
        An easy way to record tree edges is to record predecessors at the
        `tree_edge` event point.
        Nr   r   s     r   Ú	back_edgezDFSVisitor.back_edgei   s	   € ð 	ˆr   c                 ó   — dS )z…
        This is invoked on forward or cross edges in the graph.
        In an undirected graph this method is never called.
        Nr   r   s     r   Úforward_or_cross_edgez DFSVisitor.forward_or_cross_edgev   r"   r   N)	r	   r
   r   r   r   r   r!   r2   r4   r   r   r   r+   r+   K   si   € € € € € ðð ð
ð ð ðð ð ðð ð ðð ð ðð ð ð ð r   r+   c                   ó0   — e Zd ZdZd„ Zd„ Zd„ Zd„ Zd„ ZdS )ÚDijkstraVisitorz×A visitor object that is invoked at the event-points inside the
    :func:`~rustworkx.dijkstra_search` algorithm. By default, it performs no
    action, and should be used as a base class in order to be useful.
    c                 ó   — dS )zÅ
        This is invoked when a vertex is encountered for the first time and
        it's popped from the queue. Together with the node, we report the optimal
        distance of the node.
        Nr   )r   r   Úscores      r   r   zDijkstraVisitor.discover_vertex„   r'   r   c                 ó   — dS r   r   r   s     r   r   zDijkstraVisitor.finish_vertexŒ   r   r   c                 ó   — dS )zZ
        This is invoked on every out-edge of each vertex after it is discovered.
        Nr   ©r   Úedges     r   Úexamine_edgezDijkstraVisitor.examine_edge’   r   r   c                 ó   — dS )zx
        Upon examination, if the distance of the target of the edge is reduced,
        this event is emitted.
        Nr   r;   s     r   Úedge_relaxedzDijkstraVisitor.edge_relaxed˜   r"   r   c                 ó   — dS )zV
        Upon examination, if the edge is not relaxed, this event is emitted.
        Nr   r;   s     r   Úedge_not_relaxedz DijkstraVisitor.edge_not_relaxedŸ   r   r   N)	r	   r
   r   r   r   r   r=   r?   rA   r   r   r   r6   r6   ~   si   € € € € € ðð ð
ð ð ðð ð ðð ð ðð ð ðð ð ð ð r   r6   N)
Útypingr   r   r   Ú	Exceptionr   r   r   r+   r6   r   r   r   ú<module>rD      s  ðð $Ð #Ð #Ð #Ð #Ð #Ð #Ð #à€WˆT�]„]€ð	ð 	ð 	ð 	ð 	�ñ 	ô 	ð 	ð	ð 	ð 	ð 	ð 	�)ñ 	ô 	ð 	ð.ð .ð .ð .ð .�˜”ñ .ô .ð .ðb0ð 0ð 0ð 0ð 0�˜”ñ 0ô 0ð 0ðf%ð %ð %ð %ð %�g˜b”kñ %ô %ð %ð %ð %r   