pub struct Vf2State<'a, G: GetAdjacencyMatrix> {
pub graph: &'a G,
pub mapping: Vec<usize>,
out: Vec<usize>,
ins: Vec<usize>,
pub out_size: usize,
pub ins_size: usize,
pub adjacency_matrix: G::AdjMatrix,
generation: usize,
}Fields§
§graph: &'a GA reference to the graph this state was built from.
mapping: Vec<usize>The current mapping M(s) of nodes from G0 → G1 and G1 → G0,
usize::MAX for no mapping.
out: Vec<usize>out[i] is non-zero if i is in either M_0(s) or Tout_0(s) These are all the next vertices that are not mapped yet, but have an outgoing edge from the mapping.
ins: Vec<usize>ins[i] is non-zero if i is in either M_0(s) or Tin_0(s) These are all the incoming vertices, those not mapped yet, but have an edge from them into the mapping. Unused if graph is undirected – it’s identical with out in that case.
out_size: usize§ins_size: usize§adjacency_matrix: G::AdjMatrix§generation: usizeImplementations§
Source§impl<'a, G> Vf2State<'a, G>
impl<'a, G> Vf2State<'a, G>
pub fn new(g: &'a G) -> Self
Sourcepub fn is_complete(&self) -> bool
pub fn is_complete(&self) -> bool
Return true if we have a complete mapping
Sourcepub fn push_mapping(&mut self, from: G::NodeId, to: usize)
pub fn push_mapping(&mut self, from: G::NodeId, to: usize)
Add mapping from <-> to to the state.
Sourcepub fn pop_mapping(&mut self, from: G::NodeId)
pub fn pop_mapping(&mut self, from: G::NodeId)
Restore the state to before the last added mapping
Sourcepub fn next_out_index(&self, from_index: usize) -> Option<usize>
pub fn next_out_index(&self, from_index: usize) -> Option<usize>
Find the next (least) node in the Tout set.
Sourcepub fn next_in_index(&self, from_index: usize) -> Option<usize>
pub fn next_in_index(&self, from_index: usize) -> Option<usize>
Find the next (least) node in the Tin set.
Sourcepub fn next_rest_index(&self, from_index: usize) -> Option<usize>
pub fn next_rest_index(&self, from_index: usize) -> Option<usize>
Find the next (least) node in the N - M set.