scirs2_graph/alignment/mod.rs
1//! Network alignment algorithms for finding correspondences between graphs.
2//!
3//! This module provides algorithms for aligning nodes across two different graphs,
4//! finding mappings that preserve topological structure. Applications include
5//! protein interaction network alignment, social network de-anonymization,
6//! and ontology matching.
7//!
8//! # Algorithms
9//!
10//! - **IsoRank** (Singh et al., 2008): Spectral method using power iteration
11//! on the Kronecker product of adjacency matrices.
12//! - **GRASP**: Meta-heuristic combining greedy randomized construction
13//! with local search refinement.
14//!
15//! # Example
16//!
17//! ```rust
18//! use scirs2_graph::alignment::{isorank, AlignmentConfig};
19//! use scirs2_core::ndarray::Array2;
20//!
21//! // Create two small graphs (path graphs)
22//! let mut adj1 = Array2::zeros((3, 3));
23//! adj1[[0, 1]] = 1.0; adj1[[1, 0]] = 1.0;
24//! adj1[[1, 2]] = 1.0; adj1[[2, 1]] = 1.0;
25//!
26//! let adj2 = adj1.clone();
27//! let config = AlignmentConfig::default();
28//!
29//! let result = isorank(&adj1, &adj2, None, &config).expect("alignment should succeed");
30//! assert!(!result.mapping.is_empty());
31//! ```
32
33pub mod evaluation;
34pub mod grasp;
35pub mod isorank;
36pub mod types;
37
38// Re-export primary types and functions
39pub use evaluation::{
40 edge_conservation, induced_conserved_structure, node_correctness, symmetric_substructure_score,
41};
42pub use grasp::grasp_alignment;
43pub use isorank::isorank;
44pub use types::{AlignmentConfig, AlignmentResult, SimilarityMatrix};