Struct graaf::adjacency_list::digraph::Digraph

source ·
pub struct Digraph { /* private fields */ }
Expand description

An adjacency list representation of an unweighted digraph

Trait Implementations§

source§

impl AddArc for Digraph

source§

fn add_arc(&mut self, u: usize, v: usize)

Adds an arc from u to v to the digraph. Read more
source§

impl ArcWeight<usize> for Digraph

source§

fn arc_weight(&self, u: usize, v: usize) -> Option<&usize>

Returns the weight of the arc from u to v if it exists in the digraph. Read more
source§

impl Arcs for Digraph

source§

fn arcs(&self) -> impl Iterator<Item = (usize, usize)>

Returns an iterator over the arcs in the digraph.
source§

impl ArcsWeighted<usize> for Digraph

source§

fn arcs_weighted<'a>( &'a self, ) -> impl Iterator<Item = (usize, usize, &'a usize)>
where usize: 'a,

Returns an iterator over the weighted arcs in the digraph.
source§

impl Clone for Digraph

source§

fn clone(&self) -> Digraph

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Converse for Digraph

source§

fn converse(&self) -> Self

Generates the converse of the digraph
source§

impl Debug for Digraph

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Empty for Digraph

source§

fn empty(order: usize) -> Self

Generates an empty digraph. Read more
source§

fn trivial() -> Self
where Self: Sized,

Generates a trivial digraph. Read more
source§

impl From<Vec<BTreeSet<usize>>> for Digraph

source§

fn from(arcs: Vec<BTreeSet<usize>>) -> Self

Converts to this type from the input type.
source§

impl HasArc for Digraph

source§

fn has_arc(&self, u: usize, v: usize) -> bool

Returns whether an arc exists from u to v in the digraph. Read more
source§

impl Hash for Digraph

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl Indegree for Digraph

source§

fn indegree(&self, v: usize) -> usize

Returns the indegree of a vertex in the digraph. Read more
source§

fn is_source(&self, v: usize) -> bool

Returns whether a vertex is a source of the digraph. Read more
source§

impl IsSimple for Digraph

source§

fn is_simple(&self) -> bool

Returns whether the digraph is simple.
source§

impl Ord for Digraph

source§

fn cmp(&self, other: &Digraph) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
source§

impl Order for Digraph

source§

fn order(&self) -> usize

Count the vertices in the digraph.
source§

impl OutNeighbors for Digraph

source§

fn out_neighbors(&self, u: usize) -> impl Iterator<Item = usize>

§Panics

Panics if u is out of bounds.

source§

impl OutNeighborsWeighted<usize> for Digraph

source§

fn out_neighbors_weighted<'a>( &'a self, u: usize, ) -> impl Iterator<Item = (usize, &'a usize)>
where usize: 'a,

§Panics

Panics if u is out of bounds.

source§

impl Outdegree for Digraph

source§

fn outdegree(&self, u: usize) -> usize

§Panics

Panics if u is out of bounds.

source§

fn is_sink(&self, u: usize) -> bool

Returns whether a vertex is a sink of the digraph. Read more
source§

impl PartialEq for Digraph

source§

fn eq(&self, other: &Digraph) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd for Digraph

source§

fn partial_cmp(&self, other: &Digraph) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl RemoveArc for Digraph

source§

fn remove_arc(&mut self, u: usize, v: usize) -> bool

Removes the arc from u to v from the digraph. Returns whether the arc was removed. Read more
source§

impl Size for Digraph

source§

fn size(&self) -> usize

Counts the arcs in the digraph.
source§

impl Vertices for Digraph

source§

fn vertices(&self) -> impl Iterator<Item = usize>

Returns an iterator over the vertices.
source§

impl Eq for Digraph

source§

impl StructuralPartialEq for Digraph

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<D> Complete for D
where D: AddArc + Empty,

source§

fn complete(order: usize) -> D

§Panics

Panics if order is zero.

source§

impl<D> Cycle for D
where D: AddArc + Empty,

source§

fn cycle(order: usize) -> D

§Panics

Panics if order is zero.

source§

impl<T> Degree for T
where T: Indegree + Outdegree,

source§

fn degree(&self, u: usize) -> usize

Returns the degree of a vertex in the digraph. Read more
source§

impl<T> DegreeSequence for T

source§

fn degree_sequence(&self) -> Vec<(usize, usize)>

Returns the degree sequence of a digraph.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> HasEdge for T
where T: HasArc,

source§

fn has_edge(&self, u: usize, v: usize) -> bool

Returns whether the digraph has an arc from u to v and from v to u
source§

impl<D> InNeighbors for D
where D: Arcs,

source§

fn in_neighbors(&self, v: usize) -> impl Iterator<Item = usize>

Returns an iterator over the in-neighbors of a vertex in the digraph. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> IsBalanced for T

source§

fn is_balanced(&self) -> bool

Returns whether the digraph is balanced.
source§

impl<D> IsComplete for D
where D: HasEdge + Order,

source§

fn is_complete(&self) -> bool

Determines whether the digraph is complete.
source§

impl<T> IsIsolated for T
where T: Indegree + Outdegree,

source§

fn is_isolated(&self, u: usize) -> bool

Returns whether the vertex is isolated in the digraph.
source§

impl<T> IsOriented for T
where T: Arcs + HasArc,

source§

fn is_oriented(&self) -> bool

Returns whether the digraph is oriented.
source§

impl<T> IsPendant for T
where T: Degree,

source§

fn is_pendant(&self, u: usize) -> bool

Returns true if the vertex is a pendant vertex in the digraph and false otherwise
source§

impl<T> IsRegular for T

source§

fn is_regular(&self) -> bool

§Panics

Panics if the digraph has no vertices.

source§

impl<D> IsSemicomplete for D
where D: HasArc + Order,

source§

fn is_semicomplete(&self) -> bool

Determines whether the digraph is semicomplete.
source§

impl<T> IsSubdigraph for T
where T: Arcs + HasArc + Vertices,

source§

fn is_subdigraph(&self, d: &T) -> bool

Determines whether the digraph is a subdigraph of another digraph.
source§

impl<T> IsSuperdigraph for T
where T: IsSubdigraph,

source§

fn is_superdigraph(&self, d: &T) -> bool

Determines whether the digraph is a superdigraph of another digraph.
source§

impl<T> IsSymmetric for T
where T: Arcs + HasArc,

source§

fn is_symmetric(&self) -> bool

Returns whether the digraph is symmetric.
source§

impl<T> IsWalk for T
where T: HasArc,

source§

fn is_walk(&self, walk: &[usize]) -> bool

Returns whether the sequence of vertices is a walk in the digraph.
source§

impl<D> RandomTournament for D
where D: AddArc + Empty,

source§

fn random_tournament(order: usize) -> D

Generates a random tournament.
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.