pub struct GenericGraph<T, A> { /* private fields */ }
Expand description
§Generic graph implementation
- contains multiple measurable quantities
Implementations§
Source§impl<T, A> GenericGraph<T, A>where
T: Node,
A: AdjContainer<T>,
impl<T, A> GenericGraph<T, A>where
T: Node,
A: AdjContainer<T>,
Source§impl<T, A> GenericGraph<T, A>where
A: AdjContainer<T>,
impl<T, A> GenericGraph<T, A>where
A: AdjContainer<T>,
Sourcepub fn clear_edges(&mut self)
pub fn clear_edges(&mut self)
§removes all edges from the graph
- inexpensive O(1), if there are no edges to begin with
- O(vertices) otherwise
Sourcepub fn sort_adj(&mut self)
pub fn sort_adj(&mut self)
§Sort adjecency lists
If you depend on the order of the adjecency lists, you can sort them
§Performance
- internally uses pattern-defeating quicksort as long as that is the standard
- sorts an adjecency list with length
d
in worst-case:O(d log(d))
- is called for each adjecency list, i.e.,
self.vertex_count()
times
Sourcepub fn container(&self, index: usize) -> &A
pub fn container(&self, index: usize) -> &A
§get AdjContainer
of vertex index
- panics if index out of bounds
Sourcepub fn container_checked(&self, index: usize) -> Option<&A>
pub fn container_checked(&self, index: usize) -> Option<&A>
§get AdjContainer
of vertex index
None
if index is out of boundsSome(&A)
else
Sourcepub fn container_iter(&self) -> Iter<'_, A>
pub fn container_iter(&self) -> Iter<'_, A>
- get iterator over AdjContainer in order of the indices
- iterator returns
AdjContainer<Node>
Sourcepub fn container_iter_neighbors(&self, index: usize) -> NContainerIter<'_, T, A> ⓘ
pub fn container_iter_neighbors(&self, index: usize) -> NContainerIter<'_, T, A> ⓘ
-
iterate over
AdjContainer
of neighbors of vertexindex
-
iterator returns
AdjContainer<Node>
-
sort_adj
will affect the orderIf
let mut iter = self.contained_iter_neighbors()
is called directly afterself.sort_adj()
, the following will be true (as long asiter
does not returnNone
of cause):iter.next().unwrap().id() < iter.next().unwrap.id() < ...
Note, that...id()
returns the index of the corresponding vertex -
panics if index out of bounds
Sourcepub fn contained_iter(&self) -> ContainedIter<'_, T, A> ⓘ
pub fn contained_iter(&self) -> ContainedIter<'_, T, A> ⓘ
- get iterator over additional information stored at each vertex in order of the indices
- iterator returns a
Node
(for exampleEmptyNode
or whatever you used) - similar to
self.container_iter().map(|container| container.contained())
Sourcepub fn contained_iter_mut(&mut self) -> ContainedIterMut<'_, T, A> ⓘ
pub fn contained_iter_mut(&mut self) -> ContainedIterMut<'_, T, A> ⓘ
- same as
contained_iter
, but mutable
Sourcepub fn contained_iter_neighbors(&self, index: usize) -> NContainedIter<'_, T, A> ⓘ
pub fn contained_iter_neighbors(&self, index: usize) -> NContainedIter<'_, T, A> ⓘ
- iterate over additional information of neighbors of vertex
index
- iterator returns
&T
sort_adj
will affect the order- panics if index out of bounds
Sourcepub fn contained_iter_neighbors_with_index(
&self,
index: usize,
) -> NIContainedIter<'_, T, A> ⓘ
pub fn contained_iter_neighbors_with_index( &self, index: usize, ) -> NIContainedIter<'_, T, A> ⓘ
- iterate over additional information of neighbors of vertex
index
- iterator returns (
index_neighbor
,&T
) sort_adj
will affect the order- panics if index out of bounds
Sourcepub fn contained_iter_neighbors_mut(
&mut self,
index: usize,
) -> NContainedIterMut<'_, T, A> ⓘ
pub fn contained_iter_neighbors_mut( &mut self, index: usize, ) -> NContainedIterMut<'_, T, A> ⓘ
- iterate over mutable additional information of neighbors of vertex
index
- iterator returns
&mut T
sort_adj
will affect the order- panics if index out of bounds
- See also:
GraphIteratorsMut
Sourcepub fn contained_iter_neighbors_mut_with_index(
&mut self,
index: usize,
) -> INContainedIterMut<'_, T, A> ⓘ
pub fn contained_iter_neighbors_mut_with_index( &mut self, index: usize, ) -> INContainedIterMut<'_, T, A> ⓘ
- iterate over mutable additional information of neighbors of vertex
index
- iterator returns
(index_neighbor: usize, neighbor: &mut T)
sort_adj
will affect the order- panics if index out of bounds
- See also:
GraphIteratorsMut
Sourcepub fn at_checked(&self, index: usize) -> Option<&T>
pub fn at_checked(&self, index: usize) -> Option<&T>
§For your calculations etc.
- read access to your struct T, stored at each vertex, that implements
Node
trait None
if index is out of bounds
Sourcepub fn vertex_count(&self) -> usize
pub fn vertex_count(&self) -> usize
returns number of vertices present in graph
Sourcepub fn average_degree(&self) -> f32
pub fn average_degree(&self) -> f32
calculates the average degree of the graph
(2 * edge_count) / vertex_count
Sourcepub fn get_contained(&self, index: usize) -> Option<&T>
pub fn get_contained(&self, index: usize) -> Option<&T>
Returns a reference to the element stored in the specified node or None
if out of Bounds
Sourcepub fn get_contained_mut(&mut self, index: usize) -> Option<&mut T>
pub fn get_contained_mut(&mut self, index: usize) -> Option<&mut T>
Returns a mutable reference to the element stored in the specified node or None
if out of Bounds
Sourcepub unsafe fn get_contained_unchecked(&self, index: usize) -> &T
pub unsafe fn get_contained_unchecked(&self, index: usize) -> &T
Returns a reference to the element stored in the specified node
For a save alternative see get_contained
§Safety
Calling this method with an out-of-bounds index is undefined behavior even if the resulting reference is not used.
Sourcepub unsafe fn get_contained_unchecked_mut(&mut self, index: usize) -> &mut T
pub unsafe fn get_contained_unchecked_mut(&mut self, index: usize) -> &mut T
Returns a mutable reference to the element stored in the specified node
For a save alternative see get_contained_mut
§Safety
Calling this method with an out-of-bounds index is undefined behavior even if the resulting reference is not used.
Sourcepub fn remove_edge(
&mut self,
index1: usize,
index2: usize,
) -> Result<(), GraphErrors>
pub fn remove_edge( &mut self, index1: usize, index2: usize, ) -> Result<(), GraphErrors>
Sourcepub fn edge_count(&self) -> usize
pub fn edge_count(&self) -> usize
returns total number of edges in graph
Sourcepub fn degree(&self, index: usize) -> Option<usize>
pub fn degree(&self, index: usize) -> Option<usize>
- returns number of vertices adjacent to vertex
index
None
if index out of bounds
Sourcepub fn degree_vec(&self) -> Vec<usize>
pub fn degree_vec(&self) -> Vec<usize>
§get degree vector
- returns vector of length
self.vertex_count()
where each entry corresponds to the degree of the vertex with the respective index
Sourcepub fn dfs(&self, index: usize) -> Dfs<'_, T, A> ⓘ
pub fn dfs(&self, index: usize) -> Dfs<'_, T, A> ⓘ
§returns Iterator
- the iterator will iterate over the vertices in depth first search order,
beginning with vertex
index
. - iterator returns
node
- iterator always returns None if index out of bounds
§Order
Order is guaranteed to be in DFS order, however if this order is not unambigouse adding edges and especially removing edges will shuffle the order.
§Note:
Will only iterate over vertices within the connected component that contains vertex index
Sourcepub fn dfs_with_index(&self, index: usize) -> DfsWithIndex<'_, T, A> ⓘ
pub fn dfs_with_index(&self, index: usize) -> DfsWithIndex<'_, T, A> ⓘ
§returns Iterator
- the iterator will iterate over the vertices in depth first search order,
beginning with vertex
index
. - Iterator returns tuple
(index, node)
- iterator always returns None if index out of bounds
§Order
Order is guaranteed to be in DFS order, however if this order is not unambigouse adding edges and especially removing edges will shuffle the order.
§Note:
Will only iterate over vertices within the connected component that contains vertex index
Sourcepub fn bfs_index_depth(&self, index: usize) -> Bfs<'_, T, A> ⓘ
pub fn bfs_index_depth(&self, index: usize) -> Bfs<'_, T, A> ⓘ
§returns Iterator
- the iterator will iterate over the vertices in breadth first search order,
beginning with vertex
index
. - Iterator returns tuple
(index, node, depth)
§depth
- starts at 0 (i.e. the first element in the iterator will have
depth = 0
) depth
equals number of edges in the shortest path from the current vertex to the first vertex (i.e. to the vertex with indexindex
)
§Order
Order is guaranteed to be in BFS order, however if this order is not unambigouse adding edges and especially removing edges will shuffle the order.
§Note:
Will only iterate over vertices within the connected component that contains vertex index
Sourcepub fn bfs_filtered<'a, 'b, F>(
&'a self,
index: usize,
filter: &'b mut F,
) -> Option<BfsFiltered<'a, 'b, T, A, F>>
pub fn bfs_filtered<'a, 'b, F>( &'a self, index: usize, filter: &'b mut F, ) -> Option<BfsFiltered<'a, 'b, T, A, F>>
-
similar to self.bfs_index_depth, but allows for ignoring of vertices
-
the iterator will iterate over the vertices in breadth first search order, beginning with vertex
index
. -
the iterator will ignore all vertices, where
filter(vertex, index_of_vertex)
returns false -
returns
None
if index is out of bounds orfilter(vertex, index)
retruns false -
Iterator returns tuple
(index, vertex, depth)
§depth
- starts at 0 (i.e. the first element in the iterator will have
depth = 0
) depth
equals number of edges in the shortest path from the current vertex to the first vertex (i.e. to the vertex with indexindex
), while ignoring paths that go through filtered out vertices
§Order
Order is guaranteed to be in BFS order, however if this order is not unambigouse adding edges and especially removing edges will shuffle the order.
§Note:
Will only iterate over vertices within the connected component that contains vertex index
Sourcepub fn is_connected(&self) -> Option<bool>
pub fn is_connected(&self) -> Option<bool>
result | condition |
---|---|
None | if graph does not contain any vertices |
Some(true) | else if all vertices are connected by paths of edges |
Some(false) | otherwise |
Sourcepub fn q_core(&self, q: usize) -> Option<usize>
pub fn q_core(&self, q: usize) -> Option<usize>
§definition
Calculates the size of the q-core (i.e. number of nodes in the biggest possible set of nodes,
where all nodes from the set are connected with at least q
other nodes from the set)
returns None
if impossible to calculate (e.g. vertex_count == 0
or q <= 1
)
§Example
use net_ensembles::EmptyNode;
use net_ensembles::Graph;
let graph: Graph<EmptyNode> = Graph::new(0);
assert_eq!(graph.q_core(1), None);
assert_eq!(graph.q_core(2), None);
let graph2: Graph<EmptyNode> = Graph::new(1);
assert_eq!(graph2.q_core(1), None);
assert_eq!(graph2.q_core(2), Some(0));
// create complete graph
let mut graph3: Graph<EmptyNode> = Graph::new(20);
for i in 0..graph3.vertex_count() {
for j in i+1..graph3.vertex_count() {
graph3.add_edge(i, j).unwrap();
}
}
// since this is a complete graph, the q-core should always consist of 20 nodes
// as long as q < 20, as every node has 19 neighbors
for i in 2..20 {
assert_eq!(graph3.q_core(i), Some(20));
}
assert_eq!(graph3.q_core(20), Some(0));
Sourcepub fn connected_components_ids(&self) -> (usize, Vec<isize>)
pub fn connected_components_ids(&self) -> (usize, Vec<isize>)
§compute connected component ids
- used for
self.connected_components()
- each vertex gets an id, all vertices with the same id are in the same connected component
- returns (number of components, vector of ids)
Sourcepub fn connected_components(&self) -> Vec<usize>
pub fn connected_components(&self) -> Vec<usize>
§compute sizes of all connected components
- the number of connected components is the size of the returned vector, i.e.
result.len()
- returns empty vector, if graph does not contain vertices
- returns (reverse) ordered vector of sizes of the connected components,
i.e. the biggest component is of size
result[0]
and the smallest is of sizeresult[result.len() - 1]
Sourcepub fn leaf_count(&self) -> usize
pub fn leaf_count(&self) -> usize
Count number of leaves in the graph, i.e. vertices with exactly one neighbor
Sourcepub fn to_dot(&self) -> String
👎Deprecated since 0.3.0: Please use any method of the Dot
trait instead, e.g., dot_with_indices
pub fn to_dot(&self) -> String
Dot
trait instead, e.g., dot_with_indices
- Creates String which contains the topology of the network in a format that can be used by circo etc. to generate a pdf of the graph.
- indices are used as labels
- search for graphviz to learn about .dot format
Sourcepub fn to_dot_with_labels_from_contained<F, S1, S2>(
&self,
dot_options: S1,
f: F,
) -> String
👎Deprecated since 0.3.0: Please use any method of the DotExtra
trait instead, e.g., dot_from_contained_index
pub fn to_dot_with_labels_from_contained<F, S1, S2>( &self, dot_options: S1, f: F, ) -> String
DotExtra
trait instead, e.g., dot_from_contained_index
§Example
use std::fs::File;
use std::io::prelude::*;
use net_ensembles::{Graph, EmptyNode, dot_constants::EXAMPLE_DOT_OPTIONS};
let mut graph: Graph<EmptyNode> = Graph::new(3);
graph.add_edge(0, 1).unwrap();
graph.add_edge(0, 2).unwrap();
graph.add_edge(1, 2).unwrap();
// create string of dotfile
let s = graph.to_dot_with_labels_from_contained(
EXAMPLE_DOT_OPTIONS,
|_contained, index| format!("Hey {}!", index)
);
// write to file
let mut f = File::create("example.dot").expect("Unable to create file");
f.write_all(s.as_bytes()).expect("Unable to write data");
In this example, example.dot
now contains:
graph G{
bgcolor="transparent";
fontsize=50;
node [shape=ellipse, penwidth=1, fontname="Courier", pin=true ];
splines=true;
0 1 2 ;
"0" [label="Hey 0!"];
"1" [label="Hey 1!"];
"2" [label="Hey 2!"];
0 -- 1
0 -- 2
1 -- 2
}
Then you can use, e.g.,
foo@bar:~$ circo example.dot -Tpdf > example.pdf
to create a pdf representation from it. Search for graphviz to learn more.
Sourcepub fn to_dot_with_labels_from_container<F, S1, S2>(
&self,
dot_options: S1,
f: F,
) -> String
👎Deprecated since 0.3.0: Please use any method of the DotExtra
trait instead, e.g., dot_from_container_index
pub fn to_dot_with_labels_from_container<F, S1, S2>( &self, dot_options: S1, f: F, ) -> String
DotExtra
trait instead, e.g., dot_from_container_index
§Same as to_dot_with_labels_from_contained
but with access to neighbor information
§Example
use std::fs::File;
use std::io::prelude::*;
use net_ensembles::traits::*;
use net_ensembles::dot_constants::*;
use net_ensembles::{Graph,EmptyNode};
let mut graph: Graph<EmptyNode> = Graph::new(5);
graph.add_edge(0, 1).unwrap();
graph.add_edge(0, 2).unwrap();
graph.add_edge(1, 2).unwrap();
graph.add_edge(0, 3).unwrap();
graph.add_edge(3, 4).unwrap();
// create string of dotfile
let s = graph.to_dot_with_labels_from_container(
&[SPLINES, NO_OVERLAP].join("\n\t"),
|container, index|
{
container.contained(); // does nothing in this example, but you can still access
// contained, as you could in
// to_dot_with_labels_from_contained
format!("index {}, degree: {}", index, container.degree())
}
);
// write to file
let mut f = File::create("example_2.dot").expect("Unable to create file");
f.write_all(s.as_bytes()).expect("Unable to write data");
In this example, example_2.dot
now contains:
graph G{
splines=true;
overlap=false;
0 1 2 3 4 ;
"0" [label="index 0, degree: 3"];
"1" [label="index 1, degree: 2"];
"2" [label="index 2, degree: 2"];
"3" [label="index 3, degree: 2"];
"4" [label="index 4, degree: 1"];
0 -- 1
0 -- 2
0 -- 3
1 -- 2
3 -- 4
}
Then you can use, e.g.,
foo@bar:~$ circo example_2.dot -Tpdf > example_2.pdf
to create a pdf representation from it. Search for graphviz to learn more.
Sourcepub fn diameter(&self) -> Option<usize>
pub fn diameter(&self) -> Option<usize>
- returns
None
if graph not connected or does not contain any vertices - uses repeated breadth first search
Sourcepub fn longest_shortest_path_from_index(&self, index: usize) -> Option<usize>
pub fn longest_shortest_path_from_index(&self, index: usize) -> Option<usize>
calculate the size of the longest shortest path starting from vertex with index index
using breadth first search
Sourcepub fn vertex_biconnected_components(
self,
alternative_definition: bool,
) -> Vec<usize>
pub fn vertex_biconnected_components( self, alternative_definition: bool, ) -> Vec<usize>
§calculate sizes of all binode connected components
- returns (reverse) ordered vector of sizes
i.e. the biggest component is of size
result[0]
and the smallest is of sizeresult[result.len() - 1]
- destroys the underlying topology and therefore moves
self
- if you still need your graph,
use
self.clone().vertex_biconnected_components(false/true)
for your calculations
§Definition: vertex_biconnected_components(false)
Here, the (vertex) biconnected component of a graph is defined as maximal subset of nodes, where any one node could be removed and the remaining nodes would still be a connected component.
§Note
Two vertices connected by an edge are considered to be biconnected, since after the removal of one vertex (and the corresponding edge), only one vertex remains. This vertex is in a connected component with itself.
§Alternative Definition: vertex_biconnected_components(true)
If you want to use the alternative definition:
The biconnected component is defined as maximal subset of vertices, where each vertex can be reached by at least two node independent paths
The alternative definition just removes all 2s from the result vector.
§Citations
I used the algorithm described in this paper:
J. Hobcroft and R. Tarjan, “Algorithm 447: Efficient Algorithms for Graph Manipulation” Commun. ACM, 16:372-378, 1973, DOI: 10.1145/362248.362272
You can also take a look at:
M. E. J. Newman, “Networks: an Introduction” Oxfort University Press, 2010, ISBN: 978-0-19-920665-0.
Sourcepub fn vertex_load(&self, include_endpoints: bool) -> Vec<f64>
pub fn vertex_load(&self, include_endpoints: bool) -> Vec<f64>
§Closely related (most of the time equal) to betweeness
§calculates vertex_load of all vertices in O(edges * vertices)
- calculates the vertex_load for every vertex
- defined as how many shortest paths pass through each vertex
variant | |
---|---|
vertex_load(true) | includes endpoints in calculation (for a complete graph with N vertices, every node will have vertex_load N - 1 ) |
vertex_load(false) | excludes endpoints in calculation (for a complete graph with N vertices, every node will have vertex_load 0 ) |
§Citations
I used the algorithm described in
M. E. J. Newman, “Scientific collaboration networks. II. Shortest paths, weighted networks, and centrality”, Phys. Rev. E 64, 016132, 2001, DOI: 10.1103/PhysRevE.64.016132
see also:
M. E. J. Newman, “Erratum: Scientific collaboration networks. II. Shortest paths, weighted networks, and centrality”, Phys. Rev. E 73, 039906, 2006, DOI: 10.1103/PhysRevE.73.039906
Sourcepub fn transitivity(&self) -> f64
pub fn transitivity(&self) -> f64
§Calculates transitivity of graph
- related to cluster coefficient (Note: transitivity and cluster coefficient are similar, but not necessarily equal)
- returns
NaN
, if there are no paths of length two in the graph
§Definition
transitivity = (number of closed paths of length two) / (number of paths of length two)
§Citations
For the definition see for example:
M. E. J. Newman, “Networks: an Introduction” Oxfort University Press, 2010, ISBN: 978-0-19-920665-0.
Source§impl<T> GenericGraph<T, NodeContainer<T>>where
T: Node,
impl<T> GenericGraph<T, NodeContainer<T>>where
T: Node,
Sourcepub fn complete_graph(n: usize) -> Self
pub fn complete_graph(n: usize) -> Self
Efficiently create a complete graph with n nodes
Source§impl<T> GenericGraph<T, SwContainer<T>>where
T: Node + SerdeStateConform,
impl<T> GenericGraph<T, SwContainer<T>>where
T: Node + SerdeStateConform,
Sourcepub fn reset_edge(&mut self, index0: usize, index1: usize) -> SwChangeState
pub fn reset_edge(&mut self, index0: usize, index1: usize) -> SwChangeState
§Reset small-world edge to its root state
- panics if index out of bounds
- in debug: panics if
index0 == index1
Sourcepub fn rewire_edge(
&mut self,
index0: usize,
index1: usize,
index2: usize,
) -> SwChangeState
pub fn rewire_edge( &mut self, index0: usize, index1: usize, index2: usize, ) -> SwChangeState
Sourcepub fn count_nodes_with_long_ranging_edges(&self) -> usize
pub fn count_nodes_with_long_ranging_edges(&self) -> usize
§How many nodes have long ranging edges?
- counts how many nodes have long ranging edges
- A long ranging edge is defined as an edge, where is_at_root returns true, i.e., which is not in ist original ring configuration
Sourcepub fn frac_nodes_wlre(&self) -> f64
pub fn frac_nodes_wlre(&self) -> f64
§Fraction of nodes which have long ranging edges
- A long ranging edge is defined as an edge, where is_at_root returns true, i.e., which is not in ist original ring configuration
Sourcepub fn count_long_ranging_edges(&self) -> usize
pub fn count_long_ranging_edges(&self) -> usize
§How many long ranging edges are there in the Graph?
- A long ranging edge is defined as an edge, where is_at_root returns true, i.e., which is not in ist original ring configuration
Sourcepub fn frac_long_ranging_edges(&self) -> f64
pub fn frac_long_ranging_edges(&self) -> f64
§Fraction of long ranging edges in the Graph?
- A long ranging edge is defined as an edge, where is_at_root returns false, i.e., which is not in ist original ring configuration
- this is: #longranging/#total
Source§impl<T> GenericGraph<T, SpacialNodeContainer<T>>
impl<T> GenericGraph<T, SpacialNodeContainer<T>>
Sourcepub fn distance(&self, i: usize, j: usize) -> Option<f64>where
SpacialNodeContainer<T>: AdjContainer<T>,
pub fn distance(&self, i: usize, j: usize) -> Option<f64>where
SpacialNodeContainer<T>: AdjContainer<T>,
§Euclidean distance between two vertices
- Calculates the distance between the vertices
corresponding to the indices
i
andj
None
if any of the indices is out of bounds
Trait Implementations§
Source§impl<T, R> AsRef<GenericGraph<T, NodeContainer<T>>> for BAensemble<T, R>
impl<T, R> AsRef<GenericGraph<T, NodeContainer<T>>> for BAensemble<T, R>
Source§impl<T, R> AsRef<GenericGraph<T, NodeContainer<T>>> for ConfigurationModel<T, R>where
T: Node,
impl<T, R> AsRef<GenericGraph<T, NodeContainer<T>>> for ConfigurationModel<T, R>where
T: Node,
Source§impl<T, R> AsRef<GenericGraph<T, NodeContainer<T>>> for ErEnsembleC<T, R>
impl<T, R> AsRef<GenericGraph<T, NodeContainer<T>>> for ErEnsembleC<T, R>
Source§impl<T, R> AsRef<GenericGraph<T, NodeContainer<T>>> for ErEnsembleM<T, R>
impl<T, R> AsRef<GenericGraph<T, NodeContainer<T>>> for ErEnsembleM<T, R>
Source§impl<T, R> AsRef<GenericGraph<T, SpacialNodeContainer<T>>> for SpacialEnsemble<T, R>
impl<T, R> AsRef<GenericGraph<T, SpacialNodeContainer<T>>> for SpacialEnsemble<T, R>
Source§fn as_ref(&self) -> &SpacialGraph<T>
fn as_ref(&self) -> &SpacialGraph<T>
Source§impl<T, R> AsRef<GenericGraph<T, SwContainer<T>>> for SwEnsemble<T, R>
impl<T, R> AsRef<GenericGraph<T, SwContainer<T>>> for SwEnsemble<T, R>
Source§impl<T, R> AsRef<GenericGraph<T, WSContainer<T>>> for SmallWorldWS<T, R>
impl<T, R> AsRef<GenericGraph<T, WSContainer<T>>> for SmallWorldWS<T, R>
Source§impl<T, R> Borrow<GenericGraph<T, NodeContainer<T>>> for BAensemble<T, R>
impl<T, R> Borrow<GenericGraph<T, NodeContainer<T>>> for BAensemble<T, R>
Source§impl<T, R> Borrow<GenericGraph<T, NodeContainer<T>>> for ConfigurationModel<T, R>where
T: Node,
impl<T, R> Borrow<GenericGraph<T, NodeContainer<T>>> for ConfigurationModel<T, R>where
T: Node,
Source§impl<T, R> Borrow<GenericGraph<T, NodeContainer<T>>> for ErEnsembleC<T, R>
impl<T, R> Borrow<GenericGraph<T, NodeContainer<T>>> for ErEnsembleC<T, R>
Source§impl<T, R> Borrow<GenericGraph<T, NodeContainer<T>>> for ErEnsembleM<T, R>
impl<T, R> Borrow<GenericGraph<T, NodeContainer<T>>> for ErEnsembleM<T, R>
Source§impl<T, R> Borrow<GenericGraph<T, SwContainer<T>>> for SwEnsemble<T, R>
impl<T, R> Borrow<GenericGraph<T, SwContainer<T>>> for SwEnsemble<T, R>
Source§impl<T: Clone, A: Clone> Clone for GenericGraph<T, A>
impl<T: Clone, A: Clone> Clone for GenericGraph<T, A>
Source§fn clone(&self) -> GenericGraph<T, A>
fn clone(&self) -> GenericGraph<T, A>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl<'de, T, A> Deserialize<'de> for GenericGraph<T, A>where
A: Deserialize<'de>,
impl<'de, T, A> Deserialize<'de> for GenericGraph<T, A>where
A: Deserialize<'de>,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl<T, A> Dot for GenericGraph<T, A>where
T: Node,
A: AdjContainer<T>,
impl<T, A> Dot for GenericGraph<T, A>where
T: Node,
A: AdjContainer<T>,
Source§fn dot_from_indices<F, W, S1, S2>(
&self,
writer: W,
dot_options: S1,
f: F,
) -> Result<(), Error>
fn dot_from_indices<F, W, S1, S2>( &self, writer: W, dot_options: S1, f: F, ) -> Result<(), Error>
f
to create labels depending on the indexfor valid dot_options
use dot_options!
macro and take a look at module dot_constants
Read moreSource§fn dot_string_from_indices<F, S1, S2>(&self, dot_options: S1, f: F) -> String
fn dot_string_from_indices<F, S1, S2>(&self, dot_options: S1, f: F) -> String
self.dot_from_indices
but returns String instead Read moreSource§fn dot_with_indices<S, W>(&self, writer: W, dot_options: S) -> Result<(), Error>
fn dot_with_indices<S, W>(&self, writer: W, dot_options: S) -> Result<(), Error>
dot_from_indices
Read moreSource§fn dot_string_with_indices<S>(&self, dot_options: S) -> String
fn dot_string_with_indices<S>(&self, dot_options: S) -> String
self.dot_with_indices
but returns String instead Read moreSource§impl<T, A> DotExtra<T, A> for GenericGraph<T, A>where
A: AdjContainer<T>,
impl<T, A> DotExtra<T, A> for GenericGraph<T, A>where
A: AdjContainer<T>,
Source§fn dot_from_container_index<F, S1, S2, W>(
&self,
writer: W,
dot_options: S1,
f: F,
) -> Result<(), Error>
fn dot_from_container_index<F, S1, S2, W>( &self, writer: W, dot_options: S1, f: F, ) -> Result<(), Error>
A
(usually stored at each
index) to create the lables Read moreSource§fn dot_from_contained_index<F, S1, S2, W>(
&self,
writer: W,
dot_options: S1,
f: F,
) -> Result<(), Error>
fn dot_from_contained_index<F, S1, S2, W>( &self, writer: W, dot_options: S1, f: F, ) -> Result<(), Error>
T
(usually something contained in A
(see dot_from_container
)
and stored at each vertex) to create the lables Read moreSource§fn dot_string_from_container_index<F, S1, S2>(
&self,
dot_options: S1,
f: F,
) -> String
fn dot_string_from_container_index<F, S1, S2>( &self, dot_options: S1, f: F, ) -> String
self.dot_string_from_container_index
but returns String instead Read moreSource§fn dot_from_container<F, S1, S2, W>(
&self,
writer: W,
dot_options: S1,
f: F,
) -> Result<(), Error>
fn dot_from_container<F, S1, S2, W>( &self, writer: W, dot_options: S1, f: F, ) -> Result<(), Error>
A
(usually stored at each
index) to create the lables Read moreSource§fn dot_string_from_container<F, S1, S2>(&self, dot_options: S1, f: F) -> String
fn dot_string_from_container<F, S1, S2>(&self, dot_options: S1, f: F) -> String
self.dot_from_container
but returns String instead Read moreSource§fn dot_string_from_contained_index<F, S1, S2>(
&self,
dot_options: S1,
f: F,
) -> String
fn dot_string_from_contained_index<F, S1, S2>( &self, dot_options: S1, f: F, ) -> String
self.dot_from_contained
but returns String instead Read moreSource§impl<T: Node, A: AdjContainer<T>> From<&GenericGraph<T, A>> for Graph<T>
impl<T: Node, A: AdjContainer<T>> From<&GenericGraph<T, A>> for Graph<T>
Source§fn from(source: &GenericGraph<T, A>) -> Self
fn from(source: &GenericGraph<T, A>) -> Self
Source§impl<T, R> GraphIterators<T, GenericGraph<T, WSContainer<T>>, WSContainer<T>> for SmallWorldWS<T, R>
impl<T, R> GraphIterators<T, GenericGraph<T, WSContainer<T>>, WSContainer<T>> for SmallWorldWS<T, R>
Source§fn contained_iter(&self) -> ContainedIter<'_, T, WSContainer<T>> ⓘ
fn contained_iter(&self) -> ContainedIter<'_, T, WSContainer<T>> ⓘ
Node
(for example EmptyNode
or whatever you used)similar to self.container_iter().map(|container| container.contained())
Read moreSource§fn contained_iter_neighbors(
&self,
index: usize,
) -> NContainedIter<'_, T, WSContainer<T>> ⓘ
fn contained_iter_neighbors( &self, index: usize, ) -> NContainedIter<'_, T, WSContainer<T>> ⓘ
index
iterator returns &T
sort_adj
will affect the orderpanics if index out of bounds Read moreSource§fn contained_iter_neighbors_with_index(
&self,
index: usize,
) -> NIContainedIter<'_, T, WSContainer<T>> ⓘ
fn contained_iter_neighbors_with_index( &self, index: usize, ) -> NIContainedIter<'_, T, WSContainer<T>> ⓘ
index
iterator returns (index_neighbor
,&T
)sort_adj
will affect the orderpanics if index out of bounds Read moreSource§fn container_iter(&self) -> Iter<'_, WSContainer<T>>
fn container_iter(&self) -> Iter<'_, WSContainer<T>>
AdjContainer<Node>
, i.e., A
Read moreSource§fn container_iter_neighbors(
&self,
index: usize,
) -> NContainerIter<'_, T, WSContainer<T>> ⓘ
fn container_iter_neighbors( &self, index: usize, ) -> NContainerIter<'_, T, WSContainer<T>> ⓘ
index
iterator returns &T
sort_adj
will affect the orderpanics if index out of bounds Read moreSource§fn dfs_with_index(&self, index: usize) -> DfsWithIndex<'_, T, WSContainer<T>> ⓘ
fn dfs_with_index(&self, index: usize) -> DfsWithIndex<'_, T, WSContainer<T>> ⓘ
Iterator
Read moreSource§fn bfs_index_depth(&self, index: usize) -> Bfs<'_, T, WSContainer<T>> ⓘ
fn bfs_index_depth(&self, index: usize) -> Bfs<'_, T, WSContainer<T>> ⓘ
Iterator
Read moreSource§impl<T, R> GraphIteratorsMut<T, GenericGraph<T, NodeContainer<T>>, NodeContainer<T>> for BAensemble<T, R>
impl<T, R> GraphIteratorsMut<T, GenericGraph<T, NodeContainer<T>>, NodeContainer<T>> for BAensemble<T, R>
Source§fn contained_iter_neighbors_mut(
&mut self,
index: usize,
) -> NContainedIterMut<'_, T, NodeContainer<T>> ⓘ
fn contained_iter_neighbors_mut( &mut self, index: usize, ) -> NContainedIterMut<'_, T, NodeContainer<T>> ⓘ
index
iterator returns &mut T
sort_adj
will affect the orderpanics if index out of bounds Read moreSource§fn contained_iter_neighbors_mut_with_index(
&mut self,
index: usize,
) -> INContainedIterMut<'_, T, NodeContainer<T>> ⓘ
fn contained_iter_neighbors_mut_with_index( &mut self, index: usize, ) -> INContainedIterMut<'_, T, NodeContainer<T>> ⓘ
index
iterator returns (index_neighbor: usize, neighbor: &mut T)
sort_adj
will affect the orderpanics if index out of bounds Read moreSource§fn contained_iter_mut(&mut self) -> ContainedIterMut<'_, T, NodeContainer<T>> ⓘ
fn contained_iter_mut(&mut self) -> ContainedIterMut<'_, T, NodeContainer<T>> ⓘ
Node
(for example EmptyNode
or whatever you used) Read moreSource§impl<T, R> GraphIteratorsMut<T, GenericGraph<T, NodeContainer<T>>, NodeContainer<T>> for ConfigurationModel<T, R>where
T: Node,
impl<T, R> GraphIteratorsMut<T, GenericGraph<T, NodeContainer<T>>, NodeContainer<T>> for ConfigurationModel<T, R>where
T: Node,
Source§fn contained_iter_neighbors_mut(
&mut self,
index: usize,
) -> NContainedIterMut<'_, T, NodeContainer<T>> ⓘ
fn contained_iter_neighbors_mut( &mut self, index: usize, ) -> NContainedIterMut<'_, T, NodeContainer<T>> ⓘ
index
iterator returns &mut T
sort_adj
will affect the orderpanics if index out of bounds Read moreSource§fn contained_iter_neighbors_mut_with_index(
&mut self,
index: usize,
) -> INContainedIterMut<'_, T, NodeContainer<T>> ⓘ
fn contained_iter_neighbors_mut_with_index( &mut self, index: usize, ) -> INContainedIterMut<'_, T, NodeContainer<T>> ⓘ
index
iterator returns (index_neighbor: usize, neighbor: &mut T)
sort_adj
will affect the orderpanics if index out of bounds Read moreSource§fn contained_iter_mut(&mut self) -> ContainedIterMut<'_, T, NodeContainer<T>> ⓘ
fn contained_iter_mut(&mut self) -> ContainedIterMut<'_, T, NodeContainer<T>> ⓘ
Node
(for example EmptyNode
or whatever you used) Read moreSource§impl<T, R> GraphIteratorsMut<T, GenericGraph<T, NodeContainer<T>>, NodeContainer<T>> for ErEnsembleC<T, R>
impl<T, R> GraphIteratorsMut<T, GenericGraph<T, NodeContainer<T>>, NodeContainer<T>> for ErEnsembleC<T, R>
Source§fn contained_iter_neighbors_mut(
&mut self,
index: usize,
) -> NContainedIterMut<'_, T, NodeContainer<T>> ⓘ
fn contained_iter_neighbors_mut( &mut self, index: usize, ) -> NContainedIterMut<'_, T, NodeContainer<T>> ⓘ
index
iterator returns &mut T
sort_adj
will affect the orderpanics if index out of bounds Read moreSource§fn contained_iter_neighbors_mut_with_index(
&mut self,
index: usize,
) -> INContainedIterMut<'_, T, NodeContainer<T>> ⓘ
fn contained_iter_neighbors_mut_with_index( &mut self, index: usize, ) -> INContainedIterMut<'_, T, NodeContainer<T>> ⓘ
index
iterator returns (index_neighbor: usize, neighbor: &mut T)
sort_adj
will affect the orderpanics if index out of bounds Read moreSource§fn contained_iter_mut(&mut self) -> ContainedIterMut<'_, T, NodeContainer<T>> ⓘ
fn contained_iter_mut(&mut self) -> ContainedIterMut<'_, T, NodeContainer<T>> ⓘ
Node
(for example EmptyNode
or whatever you used) Read moreSource§impl<T, R> GraphIteratorsMut<T, GenericGraph<T, NodeContainer<T>>, NodeContainer<T>> for ErEnsembleM<T, R>
impl<T, R> GraphIteratorsMut<T, GenericGraph<T, NodeContainer<T>>, NodeContainer<T>> for ErEnsembleM<T, R>
Source§fn contained_iter_neighbors_mut(
&mut self,
index: usize,
) -> NContainedIterMut<'_, T, NodeContainer<T>> ⓘ
fn contained_iter_neighbors_mut( &mut self, index: usize, ) -> NContainedIterMut<'_, T, NodeContainer<T>> ⓘ
index
iterator returns &mut T
sort_adj
will affect the orderpanics if index out of bounds Read moreSource§fn contained_iter_neighbors_mut_with_index(
&mut self,
index: usize,
) -> INContainedIterMut<'_, T, NodeContainer<T>> ⓘ
fn contained_iter_neighbors_mut_with_index( &mut self, index: usize, ) -> INContainedIterMut<'_, T, NodeContainer<T>> ⓘ
index
iterator returns (index_neighbor: usize, neighbor: &mut T)
sort_adj
will affect the orderpanics if index out of bounds Read moreSource§fn contained_iter_mut(&mut self) -> ContainedIterMut<'_, T, NodeContainer<T>> ⓘ
fn contained_iter_mut(&mut self) -> ContainedIterMut<'_, T, NodeContainer<T>> ⓘ
Node
(for example EmptyNode
or whatever you used) Read moreSource§impl<T, R> GraphIteratorsMut<T, GenericGraph<T, SwContainer<T>>, SwContainer<T>> for SwEnsemble<T, R>
impl<T, R> GraphIteratorsMut<T, GenericGraph<T, SwContainer<T>>, SwContainer<T>> for SwEnsemble<T, R>
Source§fn contained_iter_neighbors_mut(
&mut self,
index: usize,
) -> NContainedIterMut<'_, T, SwContainer<T>> ⓘ
fn contained_iter_neighbors_mut( &mut self, index: usize, ) -> NContainedIterMut<'_, T, SwContainer<T>> ⓘ
index
iterator returns &mut T
sort_adj
will affect the orderpanics if index out of bounds Read moreSource§fn contained_iter_neighbors_mut_with_index(
&mut self,
index: usize,
) -> INContainedIterMut<'_, T, SwContainer<T>> ⓘ
fn contained_iter_neighbors_mut_with_index( &mut self, index: usize, ) -> INContainedIterMut<'_, T, SwContainer<T>> ⓘ
index
iterator returns (index_neighbor: usize, neighbor: &mut T)
sort_adj
will affect the orderpanics if index out of bounds Read moreSource§fn contained_iter_mut(&mut self) -> ContainedIterMut<'_, T, SwContainer<T>> ⓘ
fn contained_iter_mut(&mut self) -> ContainedIterMut<'_, T, SwContainer<T>> ⓘ
Node
(for example EmptyNode
or whatever you used) Read moreSource§impl<T, R> GraphIteratorsMut<T, GenericGraph<T, WSContainer<T>>, WSContainer<T>> for SmallWorldWS<T, R>
impl<T, R> GraphIteratorsMut<T, GenericGraph<T, WSContainer<T>>, WSContainer<T>> for SmallWorldWS<T, R>
Source§fn contained_iter_neighbors_mut(
&mut self,
index: usize,
) -> NContainedIterMut<'_, T, WSContainer<T>> ⓘ
fn contained_iter_neighbors_mut( &mut self, index: usize, ) -> NContainedIterMut<'_, T, WSContainer<T>> ⓘ
index
iterator returns &mut T
sort_adj
will affect the orderpanics if index out of bounds Read moreSource§fn contained_iter_neighbors_mut_with_index(
&mut self,
index: usize,
) -> INContainedIterMut<'_, T, WSContainer<T>> ⓘ
fn contained_iter_neighbors_mut_with_index( &mut self, index: usize, ) -> INContainedIterMut<'_, T, WSContainer<T>> ⓘ
index
iterator returns (index_neighbor: usize, neighbor: &mut T)
sort_adj
will affect the orderpanics if index out of bounds Read moreSource§fn contained_iter_mut(&mut self) -> ContainedIterMut<'_, T, WSContainer<T>> ⓘ
fn contained_iter_mut(&mut self) -> ContainedIterMut<'_, T, WSContainer<T>> ⓘ
Node
(for example EmptyNode
or whatever you used) Read moreSource§impl<T, A> Serialize for GenericGraph<T, A>where
A: Serialize,
impl<T, A> Serialize for GenericGraph<T, A>where
A: Serialize,
Source§impl<T, R> WithGraph<T, GenericGraph<T, NodeContainer<T>>> for BAensemble<T, R>
impl<T, R> WithGraph<T, GenericGraph<T, NodeContainer<T>>> for BAensemble<T, R>
Source§impl<T, R> WithGraph<T, GenericGraph<T, NodeContainer<T>>> for ConfigurationModel<T, R>where
T: Node,
impl<T, R> WithGraph<T, GenericGraph<T, NodeContainer<T>>> for ConfigurationModel<T, R>where
T: Node,
Source§fn sort_adj(&mut self)
fn sort_adj(&mut self)
§Sort adjecency lists
If you depend on the order of the adjecency lists, you can sort them
§Performance
- internally uses pattern-defeating quicksort as long as that is the standard
- sorts an adjecency list with length
d
in worst-case:O(d log(d))
- is called for each adjecency list, i.e.,
self.vertex_count()
times
Source§impl<T, R> WithGraph<T, GenericGraph<T, NodeContainer<T>>> for ErEnsembleC<T, R>
impl<T, R> WithGraph<T, GenericGraph<T, NodeContainer<T>>> for ErEnsembleC<T, R>
Source§fn sort_adj(&mut self)
fn sort_adj(&mut self)
§Sort adjecency lists
If you depend on the order of the adjecency lists, you can sort them
§Performance
- internally uses pattern-defeating quicksort as long as that is the standard
- sorts an adjecency list with length
d
in worst-case:O(d log(d))
- is called for each adjecency list, i.e.,
self.vertex_count()
times
Source§impl<T, R> WithGraph<T, GenericGraph<T, NodeContainer<T>>> for ErEnsembleM<T, R>
impl<T, R> WithGraph<T, GenericGraph<T, NodeContainer<T>>> for ErEnsembleM<T, R>
Source§fn sort_adj(&mut self)
fn sort_adj(&mut self)
§Sort adjecency lists
If you depend on the order of the adjecency lists, you can sort them
§Performance
- internally uses pattern-defeating quicksort as long as that is the standard
- sorts an adjecency list with length
d
in worst-case:O(d log(d))
- is called for each adjecency list, i.e.,
self.vertex_count()
times
Source§impl<T, R> WithGraph<T, GenericGraph<T, SwContainer<T>>> for SwEnsemble<T, R>
impl<T, R> WithGraph<T, GenericGraph<T, SwContainer<T>>> for SwEnsemble<T, R>
Source§fn sort_adj(&mut self)
fn sort_adj(&mut self)
§Sort adjecency lists
If you depend on the order of the adjecency lists, you can sort them
§Performance
- internally uses pattern-defeating quicksort as long as that is the standard
- sorts an adjecency list with length
d
in worst-case:O(d log(d))
- is called for each adjecency list, i.e.,
self.vertex_count()
times
Source§impl<T, R> WithGraph<T, GenericGraph<T, WSContainer<T>>> for SmallWorldWS<T, R>
impl<T, R> WithGraph<T, GenericGraph<T, WSContainer<T>>> for SmallWorldWS<T, R>
Auto Trait Implementations§
impl<T, A> Freeze for GenericGraph<T, A>
impl<T, A> RefUnwindSafe for GenericGraph<T, A>where
T: RefUnwindSafe,
A: RefUnwindSafe,
impl<T, A> Send for GenericGraph<T, A>
impl<T, A> Sync for GenericGraph<T, A>
impl<T, A> Unpin for GenericGraph<T, A>
impl<T, A> UnwindSafe for GenericGraph<T, A>where
T: UnwindSafe,
A: 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
Source§impl<S, T> CastFloat<T> for Swhere
T: ConvFloat<S>,
impl<S, T> CastFloat<T> for Swhere
T: ConvFloat<S>,
Source§fn cast_trunc(self) -> T
fn cast_trunc(self) -> T
Source§fn cast_nearest(self) -> T
fn cast_nearest(self) -> T
Source§fn cast_floor(self) -> T
fn cast_floor(self) -> T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T, E> GraphIterators<T, GenericGraph<T, NodeContainer<T>>, NodeContainer<T>> for E
impl<T, E> GraphIterators<T, GenericGraph<T, NodeContainer<T>>, NodeContainer<T>> for E
Source§fn contained_iter(&self) -> ContainedIter<'_, T, NodeContainer<T>> ⓘ
fn contained_iter(&self) -> ContainedIter<'_, T, NodeContainer<T>> ⓘ
Node
(for example EmptyNode
or whatever you used)similar to self.container_iter().map(|container| container.contained())
Read moreSource§fn contained_iter_neighbors(
&self,
index: usize,
) -> NContainedIter<'_, T, NodeContainer<T>> ⓘ
fn contained_iter_neighbors( &self, index: usize, ) -> NContainedIter<'_, T, NodeContainer<T>> ⓘ
index
iterator returns &T
sort_adj
will affect the orderpanics if index out of bounds Read moreSource§fn container_iter(&self) -> Iter<'_, NodeContainer<T>>
fn container_iter(&self) -> Iter<'_, NodeContainer<T>>
AdjContainer<Node>
, i.e., A
Read moreSource§fn container_iter_neighbors(
&self,
index: usize,
) -> NContainerIter<'_, T, NodeContainer<T>> ⓘ
fn container_iter_neighbors( &self, index: usize, ) -> NContainerIter<'_, T, NodeContainer<T>> ⓘ
index
iterator returns &T
sort_adj
will affect the orderpanics if index out of bounds Read moreSource§fn contained_iter_neighbors_with_index(
&self,
index: usize,
) -> NIContainedIter<'_, T, NodeContainer<T>> ⓘ
fn contained_iter_neighbors_with_index( &self, index: usize, ) -> NIContainedIter<'_, T, NodeContainer<T>> ⓘ
index
iterator returns (index_neighbor
,&T
)sort_adj
will affect the orderpanics if index out of bounds Read moreSource§fn dfs_with_index(&self, index: usize) -> DfsWithIndex<'_, T, NodeContainer<T>> ⓘ
fn dfs_with_index(&self, index: usize) -> DfsWithIndex<'_, T, NodeContainer<T>> ⓘ
Iterator
Read moreSource§fn bfs_index_depth(&self, index: usize) -> Bfs<'_, T, NodeContainer<T>> ⓘ
fn bfs_index_depth(&self, index: usize) -> Bfs<'_, T, NodeContainer<T>> ⓘ
Iterator
Read moreSource§impl<T, E> GraphIterators<T, GenericGraph<T, SwContainer<T>>, SwContainer<T>> for E
impl<T, E> GraphIterators<T, GenericGraph<T, SwContainer<T>>, SwContainer<T>> for E
Source§fn contained_iter(&self) -> ContainedIter<'_, T, SwContainer<T>> ⓘ
fn contained_iter(&self) -> ContainedIter<'_, T, SwContainer<T>> ⓘ
Node
(for example EmptyNode
or whatever you used)similar to self.container_iter().map(|container| container.contained())
Read moreSource§fn contained_iter_neighbors(
&self,
index: usize,
) -> NContainedIter<'_, T, SwContainer<T>> ⓘ
fn contained_iter_neighbors( &self, index: usize, ) -> NContainedIter<'_, T, SwContainer<T>> ⓘ
index
iterator returns &T
sort_adj
will affect the orderpanics if index out of bounds Read moreSource§fn container_iter(&self) -> Iter<'_, SwContainer<T>>
fn container_iter(&self) -> Iter<'_, SwContainer<T>>
AdjContainer<Node>
, i.e., A
Read moreSource§fn container_iter_neighbors(
&self,
index: usize,
) -> NContainerIter<'_, T, SwContainer<T>> ⓘ
fn container_iter_neighbors( &self, index: usize, ) -> NContainerIter<'_, T, SwContainer<T>> ⓘ
index
iterator returns &T
sort_adj
will affect the orderpanics if index out of bounds Read moreSource§fn contained_iter_neighbors_with_index(
&self,
index: usize,
) -> NIContainedIter<'_, T, SwContainer<T>> ⓘ
fn contained_iter_neighbors_with_index( &self, index: usize, ) -> NIContainedIter<'_, T, SwContainer<T>> ⓘ
index
iterator returns (index_neighbor
,&T
)sort_adj
will affect the orderpanics if index out of bounds Read moreSource§fn dfs_with_index(&self, index: usize) -> DfsWithIndex<'_, T, SwContainer<T>> ⓘ
fn dfs_with_index(&self, index: usize) -> DfsWithIndex<'_, T, SwContainer<T>> ⓘ
Iterator
Read moreSource§fn bfs_index_depth(&self, index: usize) -> Bfs<'_, T, SwContainer<T>> ⓘ
fn bfs_index_depth(&self, index: usize) -> Bfs<'_, T, SwContainer<T>> ⓘ
Iterator
Read moreSource§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§impl<T, A, E> MeasurableGraphQuantities<GenericGraph<T, A>> for E
impl<T, A, E> MeasurableGraphQuantities<GenericGraph<T, A>> for E
Source§fn average_degree(&self) -> f32
fn average_degree(&self) -> f32
Source§fn connected_components(&self) -> Vec<usize>
fn connected_components(&self) -> Vec<usize>
Source§fn diameter(&self) -> Option<usize>
fn diameter(&self) -> Option<usize>
None
if graph not connected or does not contain any verticesuses repeated breadth first search Read moreSource§fn edge_count(&self) -> usize
fn edge_count(&self) -> usize
Source§fn leaf_count(&self) -> usize
fn leaf_count(&self) -> usize
Source§fn longest_shortest_path_from_index(&self, index: usize) -> Option<usize>
fn longest_shortest_path_from_index(&self, index: usize) -> Option<usize>
index
using breadth first search