Complete

Struct Complete 

Source
pub struct Complete<K>{ /* private fields */ }

Implementations§

Source§

impl<K> Complete<K>

Source

pub fn new(n: u32) -> Complete<K>

Trait Implementations§

Source§

impl<K> Adjacency for Complete<K>

Source§

impl<K> Choose for Complete<K>

Source§

fn choose_vertex<R>( &self, rng: R, ) -> Option<<Complete<K> as WithVertex>::Vertex>
where R: Rng,

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

fn choose_out_neighbor<R>( &self, v: <Complete<K> as WithVertex>::Vertex, rng: R, ) -> Option<<Complete<K> as WithVertex>::Vertex>
where R: Rng,

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

fn choose_edge<R>(&self, rng: R) -> Option<<Complete<K> as WithEdge>::Edge>
where R: Rng,

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

fn choose_out_edge<R>( &self, v: <Complete<K> as WithVertex>::Vertex, rng: R, ) -> Option<<Complete<K> as WithEdge>::Edge>
where R: Rng,

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

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

Returns an iterator that repeatedly calls choose_vertex.
Source§

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

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

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

Returns an iterator that repeatedly calls choose_edge.
Source§

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

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

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

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<K> Clone for Complete<K>

Source§

fn clone(&self) -> Complete<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<K> Debug for Complete<K>

Source§

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

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

impl<K> EdgeList for Complete<K>

Source§

fn edges(&self) -> <Complete<K> as EdgeTypes<'_, Complete<K>>>::EdgeIter

Source§

fn num_edges(&self) -> usize

Source§

fn get_edge_by_ends( &self, u: <Complete<K> as WithVertex>::Vertex, v: <Complete<K> as WithVertex>::Vertex, ) -> Option<<Complete<K> as WithEdge>::Edge>

Source§

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

Source§

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

Source§

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

Source§

impl<'a, K> EdgeTypes<'a, Complete<K>> for Complete<K>

Source§

impl<K> Incidence for Complete<K>

Source§

fn out_edges( &self, v: <Complete<K> as WithVertex>::Vertex, ) -> <Complete<K> as EdgeTypes<'_, Complete<K>>>::OutEdgeIter

Source§

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

Source§

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

Source§

impl<K> PartialEq for Complete<K>

Source§

fn eq(&self, other: &Complete<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<K> VertexList for Complete<K>

Source§

impl<'a, K> VertexTypes<'a, Complete<K>> for Complete<K>

Source§

impl<K> WithEdge for Complete<K>

Source§

type Kind = K

Source§

type Edge = <K as CompleteEdgeKind>::Edge

Source§

type OptionEdge = Optioned<<K as CompleteEdgeKind>::Edge, MaxNone<<K as CompleteEdgeKind>::Edge>>

Source§

fn source( &self, e: <Complete<K> as WithEdge>::Edge, ) -> <Complete<K> as WithVertex>::Vertex

Source§

fn target( &self, e: <Complete<K> as WithEdge>::Edge, ) -> <Complete<K> as WithVertex>::Vertex

Source§

fn end_vertices( &self, e: <Complete<K> as WithEdge>::Edge, ) -> (<Complete<K> as WithVertex>::Vertex, <Complete<K> as WithVertex>::Vertex)

Source§

fn orientation(&self, _e: <Complete<K> as WithEdge>::Edge) -> Orientation

Source§

fn reverse( &self, e: <Complete<K> as WithEdge>::Edge, ) -> <Complete<K> as WithEdge>::Edge

Source§

fn get_reverse( &self, e: <Complete<K> as WithEdge>::Edge, ) -> Option<<Complete<K> as WithEdge>::Edge>

Source§

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

Source§

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

Source§

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

Source§

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

Source§

fn edge_none() -> Self::OptionEdge

Source§

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

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(Self::Edge) -> T, T: Default + Clone,

Source§

impl<K> WithEdgeIndexProp for Complete<K>

Source§

impl<T, K> WithEdgeProp<T> for Complete<K>

Source§

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

Source§

fn default_edge_prop(&self, value: T) -> Self::EdgeProp
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(Self::Edge) -> 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<K> WithVertex for Complete<K>

Source§

type Vertex = u32

Source§

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

Source§

fn vertex_none() -> Self::OptionVertex

Source§

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

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(Self::Vertex) -> T, T: Default + Clone,

Source§

impl<K> WithVertexIndexProp for Complete<K>

Source§

type VertexIndexProp = CVertexIndexProp

Source§

fn vertex_index(&self) -> CVertexIndexProp

Creates an vertex index map.
Source§

impl<T, K> WithVertexProp<T> for Complete<K>

Source§

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

The vertex property type.
Source§

fn default_vertex_prop(&self, value: T) -> Self::VertexProp
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(Self::Vertex) -> 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<K> BasicEdgeProps for Complete<K>

Source§

impl<K> BasicProps for Complete<K>

Source§

impl<K> BasicVertexProps for Complete<K>

Source§

impl<K> Copy for Complete<K>

Source§

impl<K> Eq for Complete<K>
where K: Eq + CompleteEdgeKind,

Source§

impl<K> StructuralPartialEq for Complete<K>

Auto Trait Implementations§

§

impl<K> Freeze for Complete<K>

§

impl<K> RefUnwindSafe for Complete<K>
where K: RefUnwindSafe,

§

impl<K> Send for Complete<K>
where K: Send,

§

impl<K> Sync for Complete<K>
where K: Sync,

§

impl<K> Unpin for Complete<K>
where K: Unpin,

§

impl<K> UnwindSafe for Complete<K>
where K: UnwindSafe,

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<VecDeque<(Self::OptionEdge, Self::Vertex)>>>
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§

fn num_components(&self) -> u64

Source§

fn connected_components(&self) -> ConnectedComponents<Self, Self::VertexProp>

Source§

fn is_connected(&self) -> bool

Source§

fn cut_vertices(&self) -> Vec<Self::Vertex>
where Self: Graph,

Source§

fn cut_edges(&self) -> Vec<Self::Edge>
where Self: Graph,

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) -> Self::VertexProp
where Self: WithEdge + WithVertexProp<u32>, I: IntoIterator, <I as IntoIterator>::Item: IntoOwned<Self::Edge>,

Source§

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

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: Self::Vertex) -> bool
where Self: WithEdge<Kind = Undirected>,

Source§

fn is_pendant(&self, v: Self::Vertex) -> 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<Vec<(Self::OptionEdge, Self::Vertex, Self::OutEdgeIter)>>>
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<Self::Edge>, 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: Self::Vertex, v: Self::Vertex) -> Option<Vec<Self::Edge>>
where Self: WithVertexProp<Color>,

Source§

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

Source§

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

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, Self::OptionEdge>, Owned<BinaryHeap<QueueItem<T, Self::Vertex>>>, 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 as IntoIterator>::Item: IntoOwned<Self::Edge>,

Source§

fn independent_vertex_set_from_iter<I>( &self, vertices: I, ) -> IndependentVertexSetFromIter<'_, Self, <I as IntoIterator>::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