[][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 */ }

Methods

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> Send for SimilarityMatrix<'a, F, G, E, N> where
    F: Send,
    G: Sync

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

Blanket Implementations

impl<T> From for T[src]

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

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

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

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

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

The type returned in the event of a conversion error.