[][src]Struct hibitgraph::BitGraph

pub struct BitGraph { /* fields omitted */ }

A BitGraph is an undirected graph data structure Its capacity is limited to mem::size_of::<usize>.pow(4)

Implementations

impl BitGraph[src]

pub fn with_capacity(capacity: u32) -> BitGraph[src]

Creates a new BitGraph preallocated with up to capacity vertices It is not possible later add vertices >= capacity

pub fn complete(capacity: u32) -> BitGraph[src]

Creates a new BitGraph with capacity vertices, with all vertices connected to each other. It is not possible later add vertices >= capacity

pub fn add_edge(&mut self, u: u32, v: u32)[src]

Adds a new undirected edge from u to v If the edge already exists, the graph is not updated It is not possible to add edges with endpoints >= capacity

pub fn add_edge_unchecked(&mut self, u: u32, v: u32)[src]

Same as add_edge except that no boundary checks are performed. Can corrupt the underlying data

pub fn remove_edge(&mut self, u: u32, v: u32)[src]

Removes the edge from u to v after performing boundary checks. If the edge is not present the graph is not updated

pub fn remove_edge_unchecked(&mut self, u: u32, v: u32)[src]

Same as remove_edge except that no boundary checks are performed Can corrupt the underlying data

pub fn contract_edge(&mut self, target: u32, source: u32)[src]

Contracts the edge (target, source) by adding all neighbors of source to target and removing source

pub fn contract_edge_unchecked(&mut self, target: u32, source: u32)[src]

Same as contract_edge without any boundary checks This is very unsafe, and can corrupt the entire graph if the function is called with invalid arguments

pub fn neighbors(&self, v: u32) -> BitIter<&BitSet>[src]

Returns an iterator over the neighborhood of vertex v

pub fn order(&self) -> u32[src]

Number of vertices in the graph

pub fn degree(&self, v: u32) -> u32[src]

Number of neighbors of v

pub fn dfs(&self, v: u32) -> DfsIterator[src]

Returns a DfsIterator starting at vertex v

Trait Implementations

impl Clone for BitGraph[src]

impl Debug for BitGraph[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.