Skip to main content

Vf2State

Struct Vf2State 

Source
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 G

A 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: usize

Implementations§

Source§

impl<'a, G> Vf2State<'a, G>

Source

pub fn new(g: &'a G) -> Self

Source

pub fn is_complete(&self) -> bool

Return true if we have a complete mapping

Source

pub fn push_mapping(&mut self, from: G::NodeId, to: usize)

Add mapping from <-> to to the state.

Source

pub fn pop_mapping(&mut self, from: G::NodeId)

Restore the state to before the last added mapping

Source

pub fn next_out_index(&self, from_index: usize) -> Option<usize>

Find the next (least) node in the Tout set.

Source

pub fn next_in_index(&self, from_index: usize) -> Option<usize>

Find the next (least) node in the Tin set.

Source

pub fn next_rest_index(&self, from_index: usize) -> Option<usize>

Find the next (least) node in the N - M set.

Trait Implementations§

Source§

impl<'a, G: Debug + GetAdjacencyMatrix> Debug for Vf2State<'a, G>
where G::AdjMatrix: Debug,

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a, G> Freeze for Vf2State<'a, G>

§

impl<'a, G> RefUnwindSafe for Vf2State<'a, G>

§

impl<'a, G> Send for Vf2State<'a, G>

§

impl<'a, G> Sync for Vf2State<'a, G>

§

impl<'a, G> Unpin for Vf2State<'a, G>

§

impl<'a, G> UnsafeUnpin for Vf2State<'a, G>

§

impl<'a, G> UnwindSafe for Vf2State<'a, G>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.