pub struct SimilarityMatrix<'a, F, G, E, N>{ /* private fields */ }Implementations§
Source§impl<'a, F, G, E, N> SimilarityMatrix<'a, F, G, E, N>
impl<'a, F, G, E, N> SimilarityMatrix<'a, F, G, E, N>
pub fn new( graph_a: &'a G, graph_b: &'a G, node_color_matching: F, ) -> SimilarityMatrix<'a, F, G, E, N>
Sourcepub fn iterate(&mut self, stop_after_iter: usize, eps: f32)
pub fn iterate(&mut self, stop_after_iter: usize, eps: f32)
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>
pub fn num_iterations(&self) -> usize
pub fn min_nodes(&self) -> usize
pub fn max_nodes(&self) -> usize
pub fn optimal_node_assignment(&self) -> Vec<Position>
Sourcepub fn score_outgoing_edge_weights_sum_norm(
&self,
node_assignment: &[Position],
norm: ScoreNorm,
) -> Closed01<f32>
pub fn score_outgoing_edge_weights_sum_norm( &self, node_assignment: &[Position], norm: ScoreNorm, ) -> Closed01<f32>
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.
Sourcepub fn score_optimal_sum_norm(
&self,
node_assignment: Option<&[Position]>,
norm: ScoreNorm,
) -> Closed01<f32>
pub fn score_optimal_sum_norm( &self, node_assignment: Option<&[Position]>, norm: ScoreNorm, ) -> Closed01<f32>
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.
Sourcepub fn score_average(&self) -> Closed01<f32>
pub fn score_average(&self) -> Closed01<f32>
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.”