[−][src]Struct hypergraph::core::Hypergraph
A directed hypergraph composed of generic vertices and hyperedges.
Fields
vertices: IndexMap<V, IndexSet<HyperedgeVertices>>
Vertices are stored as an IndexMap whose keys are the weights and values are an IndexSet containing the hyperedges which are including the current vertex.
hyperedges: IndexMap<HyperedgeVertices, IndexSet<HE>>
Hyperedges are stored as an IndexMap whose keys are a vector of vertices indexes and values are an IndexSet of weights. Having a IndexSet of weights allows having two or more hyperedges containing the same set of vertices (non-simple hypergraph).
Implementations
impl<V, HE> Hypergraph<V, HE> where
V: SharedTrait,
HE: SharedTrait,
[src]
V: SharedTrait,
HE: SharedTrait,
Hypergraph implementations.
pub fn new() -> Self
[src]
Creates a new hypergraph with no allocation.
pub fn with_capacity(vertices: usize, hyperedges: usize) -> Self
[src]
Creates a new hypergraph with the specified capacity.
pub fn add_vertex(&mut self, weight: V) -> VertexIndex
[src]
Adds a vertex as a custom weight in the hypergraph. Returns the index of the vertex.
pub fn get_vertex_weight(&self, index: VertexIndex) -> Option<&V>
[src]
Gets the weight of a vertex from its index.
pub fn count_vertices(&self) -> usize
[src]
Returns the number of vertices in the hypergraph.
pub fn add_hyperedge(
&mut self,
vertices: &[usize],
weight: HE
) -> WeightedHyperedgeIndex
[src]
&mut self,
vertices: &[usize],
weight: HE
) -> WeightedHyperedgeIndex
Adds a hyperedge as an array of vertices indexes and a custom weight in the hypergraph. Returns the weighted index of the hyperedge.
pub fn count_hyperedges(&self) -> usize
[src]
Returns the number of hyperedges in the hypergraph.
pub fn get_hyperedge_weight(
&self,
(hyperedge_index, weight_index): WeightedHyperedgeIndex
) -> Option<&HE>
[src]
&self,
(hyperedge_index, weight_index): WeightedHyperedgeIndex
) -> Option<&HE>
Gets the weight of a hyperedge from its weighted index.
pub fn get_hyperedge_vertices(
&self,
index: HyperedgeIndex
) -> Option<&HyperedgeVertices>
[src]
&self,
index: HyperedgeIndex
) -> Option<&HyperedgeVertices>
Gets the hyperedge's vertices.
pub fn get_hyperedges_intersections(
&self,
hyperedges: &[HyperedgeIndex]
) -> HyperedgeVertices
[src]
&self,
hyperedges: &[HyperedgeIndex]
) -> HyperedgeVertices
Gets the intersections of a set of hyperedges as a vector of vertices.
pub fn get_hyperedges_connections(
&self,
from: VertexIndex,
to: VertexIndex
) -> Vec<HyperedgeIndex>
[src]
&self,
from: VertexIndex,
to: VertexIndex
) -> Vec<HyperedgeIndex>
Gets the list of all hyperedges containing a matching connection from one vertex to another.
pub fn get_vertex_connections(&self, from: VertexIndex) -> Vec<VertexIndex>
[src]
Gets the list of all vertices connected to a given vertex.
pub fn render_to_graphviz_dot(&self)
[src]
Renders the hypergraph to Graphviz dot format. Due to Graphviz dot inability to render hypergraphs out of the box, unaries are rendered as vertex peripheries which can't be labelled.
Trait Implementations
impl<V: Eq + Hash + Debug, HE: Debug> Debug for Hypergraph<V, HE>
[src]
impl<'a, V, HE> Default for Hypergraph<V, HE> where
V: SharedTrait + ExtendedDebug<'a>,
HE: SharedTrait + ExtendedDebug<'a>,
[src]
V: SharedTrait + ExtendedDebug<'a>,
HE: SharedTrait + ExtendedDebug<'a>,
Auto Trait Implementations
impl<V, HE> RefUnwindSafe for Hypergraph<V, HE> where
HE: RefUnwindSafe,
V: RefUnwindSafe,
HE: RefUnwindSafe,
V: RefUnwindSafe,
impl<V, HE> Send for Hypergraph<V, HE> where
HE: Send,
V: Send,
HE: Send,
V: Send,
impl<V, HE> Sync for Hypergraph<V, HE> where
HE: Sync,
V: Sync,
HE: Sync,
V: Sync,
impl<V, HE> Unpin for Hypergraph<V, HE> where
HE: Unpin,
V: Unpin,
HE: Unpin,
V: Unpin,
impl<V, HE> UnwindSafe for Hypergraph<V, HE> where
HE: UnwindSafe,
V: UnwindSafe,
HE: UnwindSafe,
V: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,