Static

Struct Static 

Source
pub struct Static<V: Num, K: StaticEdgeKind> { /* private fields */ }

Trait Implementations§

Source§

impl<V: Num, K: StaticEdgeKind> Adjacency for Static<V, K>

Source§

fn out_neighbors(&self, v: Vertex<Self>) -> OutNeighborIter<'_, Self>

Source§

fn out_degree(&self, v: Vertex<Self>) -> usize

Source§

impl<V: Num, K: StaticEdgeKind> Choose for Static<V, K>

Source§

fn choose_vertex<R: Rng>(&self, rng: R) -> Option<Vertex<Self>>

Returns a random vertex of this graph or None if the graph has no vertices.
Source§

fn choose_out_neighbor<R: Rng>( &self, v: Vertex<Self>, rng: R, ) -> Option<Vertex<Self>>

Returns a random neighbor vertex of v or None if v has no neighbors.
Source§

fn choose_edge<R: Rng>(&self, rng: R) -> Option<Edge<Self>>

Returns a random edge of this graph or None if the graph has no edges.
Source§

fn choose_out_edge<R: Rng>(&self, v: Vertex<Self>, rng: R) -> Option<Edge<Self>>

Returns a random out edge of v or None if v has no out edges.
Source§

fn choose_vertex_iter<R: Rng>(&self, rng: R) -> ChooseVertexIter<'_, Self, R>

Returns an iterator that repeatedly calls choose_vertex.
Source§

fn choose_out_neighbor_iter<R: Rng>( &self, v: Vertex<Self>, rng: R, ) -> ChooseOutNeighborIter<'_, Self, R>

Returns an iterator that repeatedly calls choose_out_neighbor(v).
Source§

fn choose_edge_iter<R: Rng>(&self, rng: R) -> ChooseEdgeIter<'_, Self, R>

Returns an iterator that repeatedly calls choose_edge.
Source§

fn choose_out_edge_iter<R: Rng>( &self, v: Vertex<Self>, rng: R, ) -> ChooseOutEdgeIter<'_, Self, R>

Returns an iterator that repeatedly calls choose_out_edge(v).
Source§

fn random_walk<R: Rng>(&self, rng: R) -> RandomWalk<'_, Self, R>

Returns a iterator that produces a sequence of random edges that forms a walk, that is, the target vertex of the previous edge is the source vertex of the next edge.
Source§

impl<V: Clone + Num, K: Clone + StaticEdgeKind> Clone for Static<V, K>
where K::Edge: Clone,

Source§

fn clone(&self) -> Static<V, K>

Returns a duplicate 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<V: Debug + Num, K: Debug + StaticEdgeKind> Debug for Static<V, K>
where K::Edge: Debug,

Source§

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

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

impl<V: Num, K: StaticEdgeKind> EdgeList for Static<V, K>

Source§

fn num_edges(&self) -> usize

Source§

fn edges(&self) -> EdgeIter<'_, Self>

Source§

fn get_edge_by_ends( &self, u: Vertex<Self>, v: Vertex<Self>, ) -> Option<Edge<Self>>

Source§

fn edges_ends(&self) -> EdgesEnds<'_, Self, EdgeIter<'_, Self>>

Source§

fn edges_with_ends(&self) -> EdgesWithEnds<'_, Self, EdgeIter<'_, Self>>

Source§

fn edge_by_ends(&self, u: Vertex<Self>, v: Vertex<Self>) -> Edge<Self>

Source§

impl<'a, V: Num, K: StaticEdgeKind> EdgeTypes<'a, Static<V, K>> for Static<V, K>

Source§

impl<V: Num, K: StaticEdgeKind> Incidence for Static<V, K>

Source§

fn out_edges(&self, v: Vertex<Self>) -> OutEdgeIter<'_, Self>

Source§

fn out_edges_ends( &self, v: Vertex<Self>, ) -> EdgesEnds<'_, Self, OutEdgeIter<'_, Self>>

Source§

fn out_edges_with_ends( &self, v: Vertex<Self>, ) -> EdgesWithEnds<'_, Self, OutEdgeIter<'_, Self>>

Source§

impl<V: PartialEq + Num, K: PartialEq + StaticEdgeKind> PartialEq for Static<V, K>
where K::Edge: PartialEq,

Source§

fn eq(&self, other: &Static<V, K>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<V: Num, K: StaticEdgeKind> VertexList for Static<V, K>

Source§

fn num_vertices(&self) -> usize

Source§

fn vertices(&self) -> VertexIter<'_, Self>

Source§

impl<'a, V: Num, K: StaticEdgeKind> VertexTypes<'a, Static<V, K>> for Static<V, K>

Source§

impl<V: Num, K: StaticEdgeKind> WithBuilder for Static<V, K>

Source§

type Builder = StaticBuilder<V, K>

The builder for this graph type.
Source§

fn builder(num_vertices: usize, num_edges: usize) -> Self::Builder

Creates a new builder for a graph of this type with n vertices and initial capacity for m edges.
Source§

fn new_with_edges<I>(n: usize, edges: I) -> Self
where I: IntoIterator<Item = (usize, usize)>,

Creates a new graph with n vertices from edges iterator. Read more
Source§

fn new_empty(n: usize) -> Self

Creates a graph with n vertices and no edges.
Source§

fn new_complete(n: usize) -> Self
where Self: WithEdge<Kind = Undirected>,

Creates a complete graph with n vertices. Read more
Source§

fn new_complete_binary_tree(h: u32) -> Self
where Self: WithEdge<Kind = Undirected>,

Creates a graph that is a complete binary tree with height h. Read more
Source§

fn new_regular<R: Rng>(d: usize, n: usize, rng: R) -> Option<Self>
where Self: WithEdge<Kind = Undirected>,

Creates a new d-regular graph. Read more
Source§

fn new_random_tree<R: Rng>(n: usize, rng: R) -> Self

Creates a graph with n vertices that is a tree, that is, is connected and acyclic. Read more
Source§

fn new_random_tree_with_diameter<R: Rng>(n: u32, d: u32, rng: R) -> Option<Self>

Similar to [new_random_tree] but creates a tree with diameter d. Returns None if the diameter is invalid.
Source§

fn new_gn<R>(n: usize, rng: R) -> Self
where Self::Kind: UniformEdgeKind, R: Rng,

Creates a random graph with n vertices.
Source§

fn new_gn_connected<R: Rng>(n: usize, rng: R) -> Self
where Self::Kind: UniformEdgeKind,

Creates a random connected graph with n vertices.
Source§

fn new_gnm<R>(n: usize, m: usize, rng: R) -> Option<Self>
where Self::Kind: UniformEdgeKind, R: Rng,

Creates a random graph with n vertices and m edges. Read more
Source§

fn new_gnm_connected<R: Rng>(n: usize, m: usize, rng: R) -> Option<Self>
where Self::Kind: UniformEdgeKind,

Creates a random connected graph (weakly connected if Self is a digraph) with n vertices and m edges. Read more
Source§

impl<V: Num, K: StaticEdgeKind> WithEdge for Static<V, K>

Source§

type Kind = <K as StaticEdgeKind>::Kind

Source§

type Edge = <K as StaticEdgeKind>::Edge

Source§

type OptionEdge = Optioned<<Static<V, K> as WithEdge>::Edge, MaxNone<<Static<V, K> as WithEdge>::Edge>>

Source§

fn orientation(&self, _e: Edge<Self>) -> Orientation

Source§

fn source(&self, e: Edge<Self>) -> Vertex<Self>

Source§

fn target(&self, e: Edge<Self>) -> Vertex<Self>

Source§

fn get_reverse(&self, e: Edge<Self>) -> Option<Edge<Self>>

Source§

fn ends<'a, I, O>(&'a self, item: I) -> O
where I: Ends<'a, Self, O>,

Source§

fn end_vertices(&self, e: Edge<Self>) -> (Vertex<Self>, Vertex<Self>)

Source§

fn with_ends<I>(&self, iter: I) -> EdgesWithEnds<'_, Self, I::IntoIter>
where I: IntoIterator, I::Item: IntoOwned<Edge<Self>>,

Source§

fn opposite(&self, u: Vertex<Self>, e: Edge<Self>) -> Vertex<Self>

Source§

fn is_incident(&self, v: Vertex<Self>, e: Edge<Self>) -> bool

Source§

fn reverse(&self, e: Edge<Self>) -> Edge<Self>
where Self: WithEdge<Kind = Undirected>,

Source§

fn edge_none() -> OptionEdge<Self>

Source§

fn edge_some(e: Edge<Self>) -> OptionEdge<Self>

Source§

fn edge_prop<P, T>(&self, value: T) -> P
where P: EdgePropMutNew<Self, T>, T: Clone,

Source§

fn edge_prop_from_fn<P, F, T>(&self, fun: F) -> P
where Self: EdgeList, P: EdgePropMutNew<Self, T>, F: FnMut(Edge<Self>) -> T, T: Default + Clone,

Source§

impl<V: Num, K: StaticEdgeKind> WithEdgeIndexProp for Static<V, K>

Source§

type EdgeIndexProp = SEdgeIndexProp<K>

Source§

fn edge_index(&self) -> EdgeIndexProp<Self>

Creates an edge index map.
Source§

impl<T, V: Num, K: StaticEdgeKind> WithEdgeProp<T> for Static<V, K>

Source§

type EdgeProp = ArrayProp<<Static<V, K> as WithEdgeIndexProp>::EdgeIndexProp, Vec<T>>

Source§

fn default_edge_prop(&self, value: T) -> DefaultEdgePropMut<Self, T>
where T: Clone,

Creates a new default edge property where the initial value associated with each edge is value.
Source§

fn default_edge_prop_from_fn<P, F>(&self, fun: F) -> P
where Self: EdgeList, P: EdgePropMutNew<Self, T>, F: FnMut(Edge<Self>) -> T, T: Default + Clone,

Creates a new default edge property where the initial value associated with each edge e is produced by fun(e).
Source§

impl<V: Num, K: StaticEdgeKind> WithVertex for Static<V, K>

Source§

type Vertex = V

Source§

type OptionVertex = Optioned<V, MaxNone<V>>

Source§

fn vertex_none() -> OptionVertex<Self>

Source§

fn vertex_some(v: Vertex<Self>) -> OptionVertex<Self>

Source§

fn vertex_prop<P, T>(&self, value: T) -> P
where P: VertexPropMutNew<Self, T>, T: Clone,

Source§

fn vertex_prop_from_fn<P, T, F>(&self, fun: F) -> P
where Self: VertexList, P: VertexPropMutNew<Self, T>, F: FnMut(Vertex<Self>) -> T, T: Default + Clone,

Source§

impl<V: Num, K: StaticEdgeKind> WithVertexIndexProp for Static<V, K>

Source§

type VertexIndexProp = SVertexIndexProp

Source§

fn vertex_index(&self) -> VertexIndexProp<Self>

Creates an vertex index map.
Source§

impl<T, V: Num, K: StaticEdgeKind> WithVertexProp<T> for Static<V, K>

Source§

type VertexProp = ArrayProp<<Static<V, K> as WithVertexIndexProp>::VertexIndexProp, Vec<T>>

The vertex property type.
Source§

fn default_vertex_prop(&self, value: T) -> DefaultVertexPropMut<Self, T>
where T: Clone,

Creates a new default vertex property where the initial value associated with each vertex is value.
Source§

fn default_vertex_prop_from_fn<P, F>(&self, fun: F) -> P
where Self: VertexList, P: VertexPropMutNew<Self, T>, F: FnMut(Vertex<Self>) -> T, T: Default + Clone,

Creates a new default vertex property where the initial value associated with each vertex v is produced by fun(v).
Source§

impl<V: Num, K: StaticEdgeKind> BasicEdgeProps for Static<V, K>

Source§

impl<V: Num, K: StaticEdgeKind> BasicProps for Static<V, K>

Source§

impl<V: Num, K: StaticEdgeKind> BasicVertexProps for Static<V, K>

Source§

impl<V: Num, K: StaticEdgeKind> StructuralPartialEq for Static<V, K>

Auto Trait Implementations§

§

impl<V, K> Freeze for Static<V, K>

§

impl<V, K> RefUnwindSafe for Static<V, K>

§

impl<V, K> Send for Static<V, K>
where V: Send, <K as StaticEdgeKind>::Edge: Send,

§

impl<V, K> Sync for Static<V, K>
where V: Sync, <K as StaticEdgeKind>::Edge: Sync,

§

impl<V, K> Unpin for Static<V, K>
where V: Unpin, <K as StaticEdgeKind>::Edge: Unpin,

§

impl<V, K> UnwindSafe for Static<V, K>

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<G> Bfs for G
where G: WithEdge,

Source§

fn bfs<V>( &self, vis: V, ) -> BfsAlg<&Self, V, AllVertices<'_, Self>, NewVertexProp<'_, Self, Color>, Owned<BfsQueue<Self>>>
where V: Visitor<Self>,

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§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

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

impl<G> Components for G
where G: Incidence,

Source§

impl<G> Cycles for G
where G: Incidence,

Source§

impl<G> Degrees for G
where G: Adjacency,

Source§

fn degree_spanning_subgraph<I>( &self, edges: I, ) -> DefaultVertexPropMut<Self, u32>
where Self: WithEdge + WithVertexProp<u32>, I: IntoIterator, I::Item: IntoOwned<Edge<Self>>,

Source§

fn degree_add<P, I>(&self, degree: &mut P, edges: I)
where Self: WithEdge, P: VertexPropMut<Self, u32>, I: IntoIterator, I::Item: IntoOwned<Edge<Self>>,

Source§

fn is_k_regular(&self, k: usize) -> bool
where Self: WithEdge<Kind = Undirected> + VertexList,

Source§

fn is_regular(&self) -> bool
where Self: WithEdge<Kind = Undirected> + VertexList,

Source§

fn maximum_out_degree(&self) -> Option<usize>
where Self: VertexList,

Source§

fn minimum_out_degree(&self) -> Option<usize>
where Self: VertexList,

Source§

fn is_isolated(&self, v: Vertex<Self>) -> bool
where Self: WithEdge<Kind = Undirected>,

Source§

fn is_pendant(&self, v: Vertex<Self>) -> bool
where Self: WithEdge<Kind = Undirected>,

Source§

impl<G> Dfs for G
where G: WithEdge,

Source§

fn dfs<V>( &self, vis: V, ) -> DfsAlg<&Self, V, AllVertices<'_, Self>, NewVertexProp<'_, Self, Color>, Owned<DfsStack<'_, Self>>>
where V: Visitor<Self>,

Source§

impl<G> Distances for G
where G: Incidence,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> IntoOwned<T> for T

Source§

fn into_owned(self) -> T

Source§

impl<G> Kruskal for G
where G: WithUnionFind,

Source§

fn kruskal_mst<T, W>( &self, weight: W, ) -> KruskalAlg<&Self, Vec<Edge<Self>>, AcceptAll, NewUnionFind<'_, Self>>
where W: EdgePropGet<Self, T>, T: Ord,

Source§

fn kruskal( &self, ) -> KruskalAlg<&Self, AllEdges<'_, Self>, AcceptAll, NewUnionFind<'_, Self>>

Source§

impl<G> Paths for G
where G: Incidence,

Source§

fn find_path(&self, u: Vertex<Self>, v: Vertex<Self>) -> Option<Vec<Edge<Self>>>
where Self: WithVertexProp<Color>,

Source§

fn is_walk<I>(&self, edges: I) -> bool
where I: IntoIterator, I::Item: IntoOwned<Edge<Self>>,

Source§

fn is_path<I>(&self, edges: I) -> bool
where Self: WithVertexProp<bool>, I: IntoIterator, I::Item: IntoOwned<Edge<Self>>,

Source§

impl<G> Prim for G
where G: Incidence,

Source§

fn prim<W, T>( &self, w: W, ) -> PrimAlg<&Self, W, NewVertexProp<'_, Self, Color>, NewVertexProp<'_, Self, OptionEdge<Self>>, Owned<BinaryHeap<QueueItem<T, Vertex<Self>>>>, PhantomData<T>>
where W: EdgePropGet<Self, T>, T: Ord,

Source§

impl<G> RecursiveDfs for G
where G: WithEdge,

Source§

fn recursive_dfs<V>( &self, vis: V, ) -> RecursiveDfsAlg<&Self, V, AllVertices<'_, Self>, NewVertexProp<'_, Self, Color>>
where V: Visitor<Self>,

Source§

impl<G> Sets for G

Source§

fn vertices_complement<I>(&self, vertices: I) -> VerticesComplement<'_, Self>

Source§

fn edges_complement<I>(&self, edges: I) -> EdgesComplement<'_, Self>
where Self: EdgeList + WithEdgeProp<bool>, I: IntoIterator, I::Item: IntoOwned<Edge<Self>>,

Source§

fn independent_vertex_set_from_iter<I>( &self, vertices: I, ) -> IndependentVertexSetFromIter<'_, Self, I::IntoIter>

Source§

fn is_independent_vertex_set<I>(&self, vertices: I) -> bool

Source§

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

Source§

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<G> Trees for G
where G: Incidence,

Source§

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

Source§

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>,

Source§

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.
Source§

impl<G> WithSubgraph<G> for G
where G: Graph,

Source§

fn spanning_subgraph<I>(&self, iter: I) -> SpanningSubgraph<'_, G>
where I: IntoIterator, <I as IntoIterator>::Item: IntoOwned<<G as WithEdge>::Edge>,

Source§

fn empty_spanning_subgraph(&self) -> SpanningSubgraph<'_, G>

Source§

fn edge_induced_subgraph<I>(&self, edges: I) -> Subgraph<'_, G>
where I: IntoIterator, <I as IntoIterator>::Item: IntoOwned<<G as WithEdge>::Edge>,

Source§

fn induced_subgraph<I>(&self, vertices: I) -> Subgraph<'_, G>

Source§

impl<G> WithUnionFind for G
where G: Graph,

Source§

fn new_unionfind(&self) -> UnionFind<Self>

Source§

impl<T> AdjacencyDigraph for T
where T: Digraph + Adjacency,

Source§

impl<T> AdjacencyGraph for T
where T: Graph + Adjacency,

Source§

impl<T> Digraph for T
where T: VertexList + EdgeList<Kind = Directed> + BasicProps,

Source§

impl<T> Graph for T

Source§

impl<T> IncidenceDigraph for T

Source§

impl<T> IncidenceGraph for T