pub struct Hypergraph<N> { /* private fields */ }Implementations§
Source§impl<N> Hypergraph<N>
impl<N> Hypergraph<N>
pub fn new() -> Self
pub fn add_node(&mut self, data: N, position: Vec2) -> NodeId
pub fn add_hyperedge(&mut self, members: Vec<NodeId>) -> HyperedgeId
pub fn add_hyperedge_colored( &mut self, members: Vec<NodeId>, color: [f32; 4], ) -> HyperedgeId
pub fn remove_node(&mut self, id: NodeId)
pub fn remove_hyperedge(&mut self, id: HyperedgeId)
pub fn node_count(&self) -> usize
pub fn hyperedge_count(&self) -> usize
pub fn get_node(&self, id: NodeId) -> Option<&HypernodeData<N>>
pub fn get_hyperedge(&self, id: HyperedgeId) -> Option<&HyperedgeData>
pub fn node_ids(&self) -> Vec<NodeId>
pub fn hyperedge_ids(&self) -> Vec<HyperedgeId>
Sourcepub fn convex_hull(&self, he_id: HyperedgeId) -> Vec<Vec2>
pub fn convex_hull(&self, he_id: HyperedgeId) -> Vec<Vec2>
Compute convex hull of member node positions for rendering a hyperedge.
Sourcepub fn to_bipartite(&self) -> Graph<String, ()>where
N: Debug,
pub fn to_bipartite(&self) -> Graph<String, ()>where
N: Debug,
Convert hypergraph to bipartite graph representation. Each hyperedge becomes a node, connected to all its member nodes.
Sourcepub fn from_bipartite(graph: &Graph<String, ()>) -> Hypergraph<String>
pub fn from_bipartite(graph: &Graph<String, ()>) -> Hypergraph<String>
Create a hypergraph from a bipartite graph. Nodes labeled “hedge_*” become hyperedges, others become nodes.
Trait Implementations§
Source§impl<N: Clone> Clone for Hypergraph<N>
impl<N: Clone> Clone for Hypergraph<N>
Source§fn clone(&self) -> Hypergraph<N>
fn clone(&self) -> Hypergraph<N>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl<N> Freeze for Hypergraph<N>
impl<N> RefUnwindSafe for Hypergraph<N>where
N: RefUnwindSafe,
impl<N> Send for Hypergraph<N>where
N: Send,
impl<N> Sync for Hypergraph<N>where
N: Sync,
impl<N> Unpin for Hypergraph<N>where
N: Unpin,
impl<N> UnsafeUnpin for Hypergraph<N>
impl<N> UnwindSafe for Hypergraph<N>where
N: UnwindSafe,
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