[][src]Struct graph_neighbor_matching::SimilarityMatrix

pub struct SimilarityMatrix<'a, F, G, E, N> where
    F: NodeColorMatching<N>,
    G: Graph<EDGE = E, NODE = N> + 'a,
    E: Edges,
    N: Clone
{ /* fields omitted */ }

Implementations

impl<'a, F, G, E, N> SimilarityMatrix<'a, F, G, E, N> where
    F: NodeColorMatching<N>,
    G: Graph<EDGE = E, NODE = N>,
    E: Edges,
    N: Clone
[src]

pub fn new(
    graph_a: &'a G,
    graph_b: &'a G,
    node_color_matching: F
) -> SimilarityMatrix<'a, F, G, E, N>
[src]

pub fn next(&mut self)[src]

Calculates the next iteration of the similarity matrix (x[k+1]).

pub fn iterate(&mut self, stop_after_iter: usize, eps: f32)[src]

Iteratively calculate the similarity matrix.

stop_after_iter: Stop after iteration (Calculate x(stop_after_iter)) eps: When to stop the iteration

pub fn matrix(&self) -> &Array2<f32>[src]

pub fn num_iterations(&self) -> usize[src]

pub fn min_nodes(&self) -> usize[src]

pub fn max_nodes(&self) -> usize[src]

pub fn optimal_node_assignment(&self) -> Vec<Position>[src]

pub fn score_outgoing_edge_weights_sum_norm(
    &self,
    node_assignment: &[Position],
    norm: ScoreNorm
) -> Closed01<f32>
[src]

Calculate a measure how good the edge weights match up.

We start by calculating the optimal node assignment between nodes of graph A and graph B, then compare all outgoing edges of similar-assigned nodes by again using an assignment between the edge-weight differences of all edge pairs.

pub fn score_optimal_sum_norm(
    &self,
    node_assignment: Option<&[Position]>,
    norm: ScoreNorm
) -> Closed01<f32>
[src]

Sums the optimal assignment of the node similarities and normalizes (divides) by the min/max degree of both graphs. ScoreNorm::MinDegree is used as default in the paper.

pub fn score_average(&self) -> Closed01<f32>[src]

Calculates the average over the whole node similarity matrix. This is faster, as no assignment has to be found. "Graphs with greater number of automorphisms would be considered to be more self-similar than graphs without automorphisms."

Trait Implementations

impl<'a, F: Debug, G: Debug, E: Debug, N: Debug> Debug for SimilarityMatrix<'a, F, G, E, N> where
    F: NodeColorMatching<N>,
    G: Graph<EDGE = E, NODE = N> + 'a,
    E: Edges,
    N: Clone
[src]

Auto Trait Implementations

impl<'a, F, G, E, N> RefUnwindSafe for SimilarityMatrix<'a, F, G, E, N> where
    F: RefUnwindSafe,
    G: RefUnwindSafe
[src]

impl<'a, F, G, E, N> Send for SimilarityMatrix<'a, F, G, E, N> where
    F: Send,
    G: Sync
[src]

impl<'a, F, G, E, N> Sync for SimilarityMatrix<'a, F, G, E, N> where
    F: Sync,
    G: Sync
[src]

impl<'a, F, G, E, N> Unpin for SimilarityMatrix<'a, F, G, E, N> where
    F: Unpin
[src]

impl<'a, F, G, E, N> UnwindSafe for SimilarityMatrix<'a, F, G, E, N> where
    F: UnwindSafe,
    G: RefUnwindSafe
[src]

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.