Struct petgraph::algo::matching::Matching [−][src]
pub struct Matching<G: GraphBase> { /* fields omitted */ }
Expand description
Computed matching of the graph.
Implementations
Gets the matched counterpart of given node, if there is any.
Returns None
if the node is not matched or does not exist.
pub fn edges(&self) -> MatchedEdges<'_, G>ⓘNotable traits for MatchedEdges<'_, G>impl<G> Iterator for MatchedEdges<'_, G> where
G: NodeIndexable, type Item = (G::NodeId, G::NodeId);
pub fn edges(&self) -> MatchedEdges<'_, G>ⓘNotable traits for MatchedEdges<'_, G>impl<G> Iterator for MatchedEdges<'_, G> where
G: NodeIndexable, type Item = (G::NodeId, G::NodeId);
Notable traits for MatchedEdges<'_, G>
impl<G> Iterator for MatchedEdges<'_, G> where
G: NodeIndexable, type Item = (G::NodeId, G::NodeId);
Iterates over all edges from the matching.
An edge is represented by its endpoints. The graph is considered undirected and every pair of matched nodes is reported only once.
pub fn nodes(&self) -> MatchedNodes<'_, G>ⓘNotable traits for MatchedNodes<'_, G>impl<G> Iterator for MatchedNodes<'_, G> where
G: NodeIndexable, type Item = G::NodeId;
pub fn nodes(&self) -> MatchedNodes<'_, G>ⓘNotable traits for MatchedNodes<'_, G>impl<G> Iterator for MatchedNodes<'_, G> where
G: NodeIndexable, type Item = G::NodeId;
Notable traits for MatchedNodes<'_, G>
impl<G> Iterator for MatchedNodes<'_, G> where
G: NodeIndexable, type Item = G::NodeId;
Iterates over all nodes from the matching.
Returns true
if given edge is in the matching, or false
otherwise.
If any of the the nodes does not exist, false
is returned.
Returns true
if given node is in the matching, or false
otherwise.
If the node does not exist, false
is returned.
Returns true
if the matching is perfect.
A matching is perfect if every node in the graph is incident to an edge from the matching.