pub struct HypergraphSubstrate { /* private fields */ }Expand description
Hypergraph substrate for higher-order relations
Provides a substrate for storing and querying hypergraphs, supporting:
- Hyperedges spanning multiple entities
- Topological data analysis (persistent homology, Betti numbers)
- Sheaf-theoretic consistency checks
Implementations§
Source§impl HypergraphSubstrate
impl HypergraphSubstrate
Sourcepub fn new(config: HypergraphConfig) -> Self
pub fn new(config: HypergraphConfig) -> Self
Create a new hypergraph substrate
Sourcepub fn add_entity(&self, id: EntityId, metadata: Value)
pub fn add_entity(&self, id: EntityId, metadata: Value)
Add an entity to the hypergraph
Sourcepub fn contains_entity(&self, id: &EntityId) -> bool
pub fn contains_entity(&self, id: &EntityId) -> bool
Check if entity exists
Sourcepub fn create_hyperedge(
&mut self,
entities: &[EntityId],
relation: &Relation,
) -> Result<HyperedgeId, Error>
pub fn create_hyperedge( &mut self, entities: &[EntityId], relation: &Relation, ) -> Result<HyperedgeId, Error>
Sourcepub fn hyperedges_for_entity(&self, entity: &EntityId) -> Vec<HyperedgeId>
pub fn hyperedges_for_entity(&self, entity: &EntityId) -> Vec<HyperedgeId>
Query hyperedges containing a specific entity
Sourcepub fn get_hyperedge(&self, id: &HyperedgeId) -> Option<Hyperedge>
pub fn get_hyperedge(&self, id: &HyperedgeId) -> Option<Hyperedge>
Get hyperedge by ID
Sourcepub fn persistent_homology(
&self,
dimension: usize,
epsilon_range: (f32, f32),
) -> PersistenceDiagram
pub fn persistent_homology( &self, dimension: usize, epsilon_range: (f32, f32), ) -> PersistenceDiagram
Topological query: find persistent features
Computes persistent homology features in the specified dimension over the given epsilon range.
Sourcepub fn betti_numbers(&self, max_dim: usize) -> Vec<usize>
pub fn betti_numbers(&self, max_dim: usize) -> Vec<usize>
Query Betti numbers (topological invariants)
Returns the Betti numbers up to max_dim, where:
- β₀ = number of connected components
- β₁ = number of 1-dimensional holes (loops)
- β₂ = number of 2-dimensional holes (voids)
- etc.
Sourcepub fn check_sheaf_consistency(
&self,
sections: &[SectionId],
) -> SheafConsistencyResult
pub fn check_sheaf_consistency( &self, sections: &[SectionId], ) -> SheafConsistencyResult
Sheaf consistency: check local-to-global coherence
Checks if local sections are consistent on their overlaps, following the sheaf axioms.
Sourcepub fn query(&self, query: &TopologicalQuery) -> Result<HyperedgeResult, Error>
pub fn query(&self, query: &TopologicalQuery) -> Result<HyperedgeResult, Error>
Execute a topological query
Sourcepub fn stats(&self) -> HypergraphStats
pub fn stats(&self) -> HypergraphStats
Get statistics about the hypergraph
Auto Trait Implementations§
impl Freeze for HypergraphSubstrate
impl !RefUnwindSafe for HypergraphSubstrate
impl Send for HypergraphSubstrate
impl Sync for HypergraphSubstrate
impl Unpin for HypergraphSubstrate
impl !UnwindSafe for HypergraphSubstrate
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more