HyperGraph

Trait HyperGraph 

Source
pub trait HyperGraph<N, E, A>: RawHyperGraph<A>
where A: GraphProps,
{
Show 17 methods // Required methods fn add_surface<I>( &mut self, iter: I, weight: Weight<E>, ) -> Result<EdgeId<A::Ix>> where I: IntoIterator<Item = VertexId<A::Ix>>; fn add_node(&mut self, weight: Weight<N>) -> Result<VertexId<A::Ix>>; fn get_edge_domain( &self, index: &EdgeId<A::Ix>, ) -> Result<&<Self::Edge<E> as RawLayout>::Store>; fn get_edge_domain_mut( &mut self, index: &EdgeId<A::Ix>, ) -> Result<&mut <Self::Edge<E> as RawLayout>::Store>; fn get_edge(&self, index: &EdgeId<A::Ix>) -> Result<&Self::Edge<E>>; fn get_edge_mut( &mut self, index: &EdgeId<A::Ix>, ) -> Result<&mut Self::Edge<E>>; fn get_node(&self, index: &VertexId<A::Ix>) -> Result<&Self::Node<N>>; fn get_node_mut( &mut self, index: &VertexId<A::Ix>, ) -> Result<&mut Self::Node<N>>; fn get_node_weight(&self, index: &VertexId<A::Ix>) -> Result<&Weight<N>>; fn get_node_weight_mut( &mut self, index: &VertexId<A::Ix>, ) -> Result<&mut Weight<N>>; fn contains_edge(&self, index: &EdgeId<A::Ix>) -> bool; fn contains_node(&self, index: &VertexId<A::Ix>) -> bool; fn find_edges_with_node( &self, index: &VertexId<A::Ix>, ) -> impl Iterator<Item = &EdgeId<A::Ix>>; // Provided methods fn add_edge<I>(&mut self, iter: I) -> Result<EdgeId<A::Ix>> where I: IntoIterator<Item = VertexId<A::Ix>>, E: Default { ... } fn add_vertex(&mut self) -> Result<VertexId<A::Ix>> where N: Default { ... } fn get_edge_weight(&self, index: &EdgeId<A::Ix>) -> Result<&Weight<E>> { ... } fn get_edge_weight_mut( &mut self, index: &EdgeId<A::Ix>, ) -> Result<&mut Weight<E>> { ... }
}
Expand description

The HyperGraph trait directly extends the RawHyperGraph trait to provide additional utilities and constructors for implementors while establishing a more robust interface for hypergraphs. This trait is designed to abstract the basic behaviour of hypergraphs, enabling the generalization of implements algorithms and operators.

Required Methods§

Source

fn add_surface<I>( &mut self, iter: I, weight: Weight<E>, ) -> Result<EdgeId<A::Ix>>
where I: IntoIterator<Item = VertexId<A::Ix>>,

given an iterable of vertex indices and a weight, add an edge to the graph and return its index

Source

fn add_node(&mut self, weight: Weight<N>) -> Result<VertexId<A::Ix>>

add a new node to the graph with the given weight and return its index

Source

fn get_edge_domain( &self, index: &EdgeId<A::Ix>, ) -> Result<&<Self::Edge<E> as RawLayout>::Store>

returns the vertices of the edge with the given index

Source

fn get_edge_domain_mut( &mut self, index: &EdgeId<A::Ix>, ) -> Result<&mut <Self::Edge<E> as RawLayout>::Store>

returns a mutable reference to the vertices of the edge with the given index

Source

fn get_edge(&self, index: &EdgeId<A::Ix>) -> Result<&Self::Edge<E>>

returns an immutable reference to the edge with the given index

Source

fn get_edge_mut(&mut self, index: &EdgeId<A::Ix>) -> Result<&mut Self::Edge<E>>

returns a mutable reference to the edge with the given index

Source

fn get_node(&self, index: &VertexId<A::Ix>) -> Result<&Self::Node<N>>

returns a reference to the node with the given index

Source

fn get_node_mut( &mut self, index: &VertexId<A::Ix>, ) -> Result<&mut Self::Node<N>>

returns a mutable reference to the node with the given index

Source

fn get_node_weight(&self, index: &VertexId<A::Ix>) -> Result<&Weight<N>>

returns the weight of the node with the given index

Source

fn get_node_weight_mut( &mut self, index: &VertexId<A::Ix>, ) -> Result<&mut Weight<N>>

returns a mutable reference to the weight of the node with the given index

Source

fn contains_edge(&self, index: &EdgeId<A::Ix>) -> bool

returns true if the graph contains the edge with the given index

Source

fn contains_node(&self, index: &VertexId<A::Ix>) -> bool

returns true if the graph contains the node with the given index

Source

fn find_edges_with_node( &self, index: &VertexId<A::Ix>, ) -> impl Iterator<Item = &EdgeId<A::Ix>>

returns an iterator over all edges that contain the given node

Provided Methods§

Source

fn add_edge<I>(&mut self, iter: I) -> Result<EdgeId<A::Ix>>
where I: IntoIterator<Item = VertexId<A::Ix>>, E: Default,

given an iterable of vertex indices, add an edge to the graph and return its index

Source

fn add_vertex(&mut self) -> Result<VertexId<A::Ix>>
where N: Default,

add a new default node to the graph and return its index

Source

fn get_edge_weight(&self, index: &EdgeId<A::Ix>) -> Result<&Weight<E>>

returns a reference to the weight of the edge with the given index

Source

fn get_edge_weight_mut( &mut self, index: &EdgeId<A::Ix>, ) -> Result<&mut Weight<E>>

returns a mutable reference to the weight of the edge with the given index

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§