Expand description
Hypergraph algorithms and simplicial complexes.
This module provides four sub-modules:
| Sub-module | Contents |
|---|---|
core | Core data structures: IndexedHypergraph, generic Hypergraph<N,E>, clique/star/bipartite expansions |
algorithms | Spectral clustering, hyperedge cuts, stationary distribution, betweenness centrality, s-walks |
simplicial | SimplicialComplex, boundary matrices, Betti numbers, Vietoris-Rips/Čech/nerve complexes |
higher_order | MotifTensor, topological features, CellularSheaf and Hodge Laplacian |
§Quick Start
use scirs2_graph::hypergraph::{IndexedHypergraph, clique_expansion, SpectralClusteringResult};
use scirs2_graph::hypergraph::{SimplicialComplex, CellularSheaf};
// Build a hypergraph
let mut hg = IndexedHypergraph::new(5);
hg.add_hyperedge(vec![0,1,2], 1.0).unwrap();
hg.add_hyperedge(vec![2,3,4], 1.0).unwrap();
// Clique expansion → ordinary graph
let g = clique_expansion(&hg);
assert_eq!(g.node_count(), 5);
// Simplicial complex topology
let mut sc = SimplicialComplex::new();
sc.add_simplex(vec![0,1,2]);
let betti = sc.betti_numbers();
assert_eq!(betti[0], 1); // connectedRe-exports§
pub use core::clique_expansion;pub use core::hyperedge_centrality;pub use core::hypergraph_clustering_coefficient;pub use core::hypergraph_random_walk;pub use core::hypergraph_random_walk_seeded;pub use core::line_graph;pub use core::Hyperedge;pub use core::Hypergraph;pub use core::IndexedHypergraph;pub use algorithms::betweenness_centrality as hypergraph_betweenness_centrality;pub use algorithms::hyperedge_cut;pub use algorithms::s_betweenness_centrality;pub use algorithms::s_diameter;pub use algorithms::s_distance;pub use algorithms::s_reachability;pub use algorithms::spectral_clustering;pub use algorithms::stationary_distribution;pub use algorithms::CutResult;pub use algorithms::SpectralClusteringResult;pub use simplicial::SimplicialComplex;pub use higher_order::directed_motif_tensor;pub use higher_order::trivial_sheaf_from_graph;pub use higher_order::CellularSheaf;pub use higher_order::MotifTensor;pub use higher_order::TopologicalFeatures;
Modules§
- algorithms
- Hypergraph algorithms.
- attention
- Hypergraph Attention Network (HAN).
- core
- Core hypergraph data structures and expansions.
- edge_
prediction - Hyperedge Prediction module.
- higher_
order - Higher-order network analysis.
- neural
- Hypergraph Neural Network (HGNN) convolution layers.
- simplicial
- Simplicial complexes and their topological invariants.