Skip to main content

structural_similarity

Function structural_similarity 

Source
pub fn structural_similarity(
    a: &ArchitectureFingerprint,
    b: &ArchitectureFingerprint,
) -> f64
Expand description

Structural resemblance of two fingerprints in [0, 1].

0.6 · jaccard(node tokens) + 0.4 · jaccard(edge tokens), where jaccard is the multiset variant (intersection sums per-token minima, union sums maxima) so node counts matter. Deterministic and linear — deliberately not graph isomorphism, which is both expensive and too strict for “these two look alike”.

Two empty fingerprints score 1.0 (identical), an empty against a non-empty scores 0.0.