Struct net_ensembles::generic_graph::GenericGraph [−][src]
pub struct GenericGraph<T, A> { /* fields omitted */ }
Expand description
Generic graph implementation
- contains multiple measurable quantities
Implementations
removes all edges from the graph
- inexpensive O(1), if there are no edges to begin with
- O(vertices) otherwise
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
get AdjContainer
of vertex index
- panics if index out of bounds
get AdjContainer
of vertex index
None
if index is out of boundsSome(&A)
else
- get iterator over AdjContainer in order of the indices
- iterator returns
AdjContainer<Node>
pub fn container_iter_neighbors(&self, index: usize) -> NContainerIter<'_, T, A>ⓘNotable traits for NContainerIter<'a, T, A>impl<'a, T, A> Iterator for NContainerIter<'a, T, A> where
T: 'a + Node,
A: AdjContainer<T>, type Item = &'a A;
pub fn container_iter_neighbors(&self, index: usize) -> NContainerIter<'_, T, A>ⓘNotable traits for NContainerIter<'a, T, A>impl<'a, T, A> Iterator for NContainerIter<'a, T, A> where
T: 'a + Node,
A: AdjContainer<T>, type Item = &'a A;
impl<'a, T, A> Iterator for NContainerIter<'a, T, A> where
T: 'a + Node,
A: AdjContainer<T>, type Item = &'a 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
pub fn contained_iter(&self) -> ContainedIter<'_, T, A>ⓘNotable traits for ContainedIter<'a, T, A>impl<'a, T, A> Iterator for ContainedIter<'a, T, A> where
T: 'a + Node,
A: AdjContainer<T>, type Item = &'a T;
pub fn contained_iter(&self) -> ContainedIter<'_, T, A>ⓘNotable traits for ContainedIter<'a, T, A>impl<'a, T, A> Iterator for ContainedIter<'a, T, A> where
T: 'a + Node,
A: AdjContainer<T>, type Item = &'a T;
impl<'a, T, A> Iterator for ContainedIter<'a, T, A> where
T: 'a + Node,
A: AdjContainer<T>, type Item = &'a T;
- 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())
pub fn contained_iter_mut(&mut self) -> ContainedIterMut<'_, T, A>ⓘNotable traits for ContainedIterMut<'a, T, A>impl<'a, T, A> Iterator for ContainedIterMut<'a, T, A> where
T: 'a + Node,
A: AdjContainer<T>, type Item = &'a mut T;
pub fn contained_iter_mut(&mut self) -> ContainedIterMut<'_, T, A>ⓘNotable traits for ContainedIterMut<'a, T, A>impl<'a, T, A> Iterator for ContainedIterMut<'a, T, A> where
T: 'a + Node,
A: AdjContainer<T>, type Item = &'a mut T;
impl<'a, T, A> Iterator for ContainedIterMut<'a, T, A> where
T: 'a + Node,
A: AdjContainer<T>, type Item = &'a mut T;
- same as
contained_iter
, but mutable
pub fn contained_iter_neighbors(&self, index: usize) -> NContainedIter<'_, T, A>ⓘNotable traits for NContainedIter<'a, T, A>impl<'a, T, A> Iterator for NContainedIter<'a, T, A> where
T: 'a + Node,
A: AdjContainer<T>, type Item = &'a T;
pub fn contained_iter_neighbors(&self, index: usize) -> NContainedIter<'_, T, A>ⓘNotable traits for NContainedIter<'a, T, A>impl<'a, T, A> Iterator for NContainedIter<'a, T, A> where
T: 'a + Node,
A: AdjContainer<T>, type Item = &'a T;
impl<'a, T, A> Iterator for NContainedIter<'a, T, A> where
T: 'a + Node,
A: AdjContainer<T>, type Item = &'a T;
- iterate over additional information of neighbors of vertex
index
- iterator returns
&T
sort_adj
will affect the order- panics if index out of bounds
pub fn contained_iter_neighbors_with_index(
&self,
index: usize
) -> NIContainedIter<'_, T, A>ⓘNotable traits for NIContainedIter<'a, T, A>impl<'a, T, A> Iterator for NIContainedIter<'a, T, A> where
T: 'a + Node,
A: AdjContainer<T>, type Item = (usize, &'a T);
pub fn contained_iter_neighbors_with_index(
&self,
index: usize
) -> NIContainedIter<'_, T, A>ⓘNotable traits for NIContainedIter<'a, T, A>impl<'a, T, A> Iterator for NIContainedIter<'a, T, A> where
T: 'a + Node,
A: AdjContainer<T>, type Item = (usize, &'a T);
impl<'a, T, A> Iterator for NIContainedIter<'a, T, A> where
T: 'a + Node,
A: AdjContainer<T>, type Item = (usize, &'a T);
- 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
pub fn contained_iter_neighbors_mut(
&mut self,
index: usize
) -> NContainedIterMut<'_, T, A>ⓘNotable traits for NContainedIterMut<'a, T, A>impl<'a, T, A> Iterator for NContainedIterMut<'a, T, A> where
T: 'a + Node,
A: AdjContainer<T>, type Item = &'a mut T;
pub fn contained_iter_neighbors_mut(
&mut self,
index: usize
) -> NContainedIterMut<'_, T, A>ⓘNotable traits for NContainedIterMut<'a, T, A>impl<'a, T, A> Iterator for NContainedIterMut<'a, T, A> where
T: 'a + Node,
A: AdjContainer<T>, type Item = &'a mut T;
impl<'a, T, A> Iterator for NContainedIterMut<'a, T, A> where
T: 'a + Node,
A: AdjContainer<T>, type Item = &'a mut T;
- 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
pub fn contained_iter_neighbors_mut_with_index(
&mut self,
index: usize
) -> INContainedIterMut<'_, T, A>ⓘNotable traits for INContainedIterMut<'a, T, A>impl<'a, T, A> Iterator for INContainedIterMut<'a, T, A> where
T: 'a + Node,
A: AdjContainer<T>, type Item = (usize, &'a mut T);
pub fn contained_iter_neighbors_mut_with_index(
&mut self,
index: usize
) -> INContainedIterMut<'_, T, A>ⓘNotable traits for INContainedIterMut<'a, T, A>impl<'a, T, A> Iterator for INContainedIterMut<'a, T, A> where
T: 'a + Node,
A: AdjContainer<T>, type Item = (usize, &'a mut T);
impl<'a, T, A> Iterator for INContainedIterMut<'a, T, A> where
T: 'a + Node,
A: AdjContainer<T>, type Item = (usize, &'a mut T);
- 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
For your calculations etc.
- read access to your struct T, stored at each vertex, that implements
Node
trait
Note
- panics if index out of bounds
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
For your calculations etc.
- write access to your struct T, stored at each vertex, that implements
Node
trait
Note
- panics if index out of bounds
returns number of vertices present in graph
calculates the average degree of the graph
(2 * edge_count) / vertex_count
Returns a reference to the element stored in the specified node or None
if out of Bounds
Returns a mutable reference to the element stored in the specified node or None
if out of Bounds
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.
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.
Adds edge between nodes index1
and index2
ErrorCases:
Error | Reason |
---|---|
GraphErrors::IndexOutOfRange | index1 or index2 larger than self.vertex_count() |
GraphErrors::EdgeExists | requested edge already exists! |
panics
- if indices out of bounds
- in debug: If
index0 == index1
Removes edge between nodes index1 and index2
ErrorCases:
Error | Reason |
---|---|
GraphErrors::IndexOutOfRange | index1 or index2 larger than self.vertex_count() |
GraphErrors::EdgeDoesNotExist | requested edge does not exists |
panics
- if index out of bounds
- in debug: If
index0 == index1
returns total number of edges in graph
- returns number of vertices adjacent to vertex
index
None
if index out of bounds
get degree vector
- returns vector of length
self.vertex_count()
where each entry corresponds to the degree of the vertex with the respective index
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
pub fn dfs_with_index(&self, index: usize) -> DfsWithIndex<'_, T, A>ⓘNotable traits for DfsWithIndex<'a, T, A>impl<'a, T, A> Iterator for DfsWithIndex<'a, T, A> where
T: 'a,
A: AdjContainer<T>, type Item = (usize, &'a T);
pub fn dfs_with_index(&self, index: usize) -> DfsWithIndex<'_, T, A>ⓘNotable traits for DfsWithIndex<'a, T, A>impl<'a, T, A> Iterator for DfsWithIndex<'a, T, A> where
T: 'a,
A: AdjContainer<T>, type Item = (usize, &'a T);
impl<'a, T, A> Iterator for DfsWithIndex<'a, T, A> where
T: 'a,
A: AdjContainer<T>, type Item = (usize, &'a T);
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
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
pub fn bfs_filtered<'a, 'b, F>(
&'a self,
index: usize,
filter: &'b mut F
) -> Option<BfsFiltered<'a, 'b, T, A, F>> where
F: 'b + FnMut(&T, usize) -> bool,
pub fn bfs_filtered<'a, 'b, F>(
&'a self,
index: usize,
filter: &'b mut F
) -> Option<BfsFiltered<'a, 'b, T, A, F>> where
F: 'b + FnMut(&T, usize) -> bool,
-
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
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 |
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));
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)
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]
Count number of leaves in the graph, i.e. vertices with exactly one neighbor
👎 Deprecated since 0.3.0: Please use any method of the Dot
trait instead, e.g., dot_with_indices
Please use any method of the 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
pub fn to_dot_with_labels_from_contained<F, S1, S2>(
&self,
dot_options: S1,
f: F
) -> String where
S1: AsRef<str>,
S2: AsRef<str>,
F: Fn(&T, usize) -> S2,
👎 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 where
S1: AsRef<str>,
S2: AsRef<str>,
F: Fn(&T, usize) -> S2,
Please use any method of the 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.
pub fn to_dot_with_labels_from_container<F, S1, S2>(
&self,
dot_options: S1,
f: F
) -> String where
S1: AsRef<str>,
S2: AsRef<str>,
F: Fn(&A, usize) -> S2,
👎 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 where
S1: AsRef<str>,
S2: AsRef<str>,
F: Fn(&A, usize) -> S2,
Please use any method of the 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.
- returns
None
if graph not connected or does not contain any vertices - uses repeated breadth first search
calculate the size of the longest shortest path starting from vertex with index index
using breadth first search
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.
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
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.
Efficiently create a complete graph with n nodes
Reset small-world edge to its root state
- panics if index out of bounds
- in debug: panics if
index0 == index1
Rewire edges
- rewire edge
(index0, index1)
to(index0, index2)
panics
- if indices are out of bounds
- in debug: panics if
index0 == index2
- edge
(index0, index1)
has to be rooted atindex0
, else will panic in debug mode
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
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
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
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
pub 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
impl<T, R> AsRef<GenericGraph<T, NodeContainer<T>>> for ErEnsembleC<T, R> where
T: Node,
R: Rng,
impl<T, R> AsRef<GenericGraph<T, NodeContainer<T>>> for ErEnsembleC<T, R> where
T: Node,
R: Rng,
impl<T, R> AsRef<GenericGraph<T, NodeContainer<T>>> for ErEnsembleM<T, R> where
T: Node,
R: Rng,
impl<T, R> AsRef<GenericGraph<T, NodeContainer<T>>> for ErEnsembleM<T, R> where
T: Node,
R: Rng,
impl<T, R> AsRef<GenericGraph<T, NodeContainer<T>>> for BAensemble<T, R> where
T: Node,
R: Rng,
impl<T, R> AsRef<GenericGraph<T, NodeContainer<T>>> for BAensemble<T, R> where
T: Node,
R: Rng,
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,
Performs the conversion.
impl<T, R> Borrow<GenericGraph<T, NodeContainer<T>>> for ErEnsembleC<T, R> where
T: Node,
R: Rng,
impl<T, R> Borrow<GenericGraph<T, NodeContainer<T>>> for ErEnsembleC<T, R> where
T: Node,
R: Rng,
impl<T, R> Borrow<GenericGraph<T, NodeContainer<T>>> for ErEnsembleM<T, R> where
T: Node,
R: Rng,
impl<T, R> Borrow<GenericGraph<T, NodeContainer<T>>> for ErEnsembleM<T, R> where
T: Node,
R: Rng,
impl<T, R> Borrow<GenericGraph<T, NodeContainer<T>>> for BAensemble<T, R> where
T: Node,
R: Rng,
impl<T, R> Borrow<GenericGraph<T, NodeContainer<T>>> for BAensemble<T, R> where
T: Node,
R: Rng,
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,
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>,
Deserialize this value from the given Serde deserializer. Read more
f
to create labels depending on the indexdot_options
use dot_options!
macro and take a look at module dot_constants
self.dot_from_indices
but returns String instead
self.dot_with_indices
but returns String instead
self.dot()
, but returns a String instead
A
(usually stored at each
index) to create the lables
T
(usually something contained in A
(see dot_from_container
)
and stored at each vertex) to create the lables
self.dot_string_from_container_index
but returns String instead
A
(usually stored at each
index) to create the lables
self.dot_from_container
but returns String instead
self.dot_from_contained
but returns String instead
T
(usually something contained in A
(see dot_from_container
)
and stored at each vertex) to create the lablesPerforms the conversion.
impl<T, E> GraphIterators<T, GenericGraph<T, NodeContainer<T>>, NodeContainer<T>> for E where
T: Node,
E: WithGraph<T, GenericGraph<T, NodeContainer<T>>>,
impl<T, E> GraphIterators<T, GenericGraph<T, NodeContainer<T>>, NodeContainer<T>> for E where
T: Node,
E: WithGraph<T, GenericGraph<T, NodeContainer<T>>>,
fn contained_iter(&self) -> ContainedIter<'_, T, NodeContainer<T>>ⓘNotable traits for ContainedIter<'a, T, A>impl<'a, T, A> Iterator for ContainedIter<'a, T, A> where
T: 'a + Node,
A: AdjContainer<T>, type Item = &'a T;
fn contained_iter(&self) -> ContainedIter<'_, T, NodeContainer<T>>ⓘNotable traits for ContainedIter<'a, T, A>impl<'a, T, A> Iterator for ContainedIter<'a, T, A> where
T: 'a + Node,
A: AdjContainer<T>, type Item = &'a T;
impl<'a, T, A> Iterator for ContainedIter<'a, T, A> where
T: 'a + Node,
A: AdjContainer<T>, type Item = &'a T;
Node
(for example EmptyNode
or whatever you used)self.container_iter().map(|container| container.contained())
fn contained_iter_neighbors(
&self,
index: usize
) -> NContainedIter<'_, T, NodeContainer<T>>ⓘNotable traits for NContainedIter<'a, T, A>impl<'a, T, A> Iterator for NContainedIter<'a, T, A> where
T: 'a + Node,
A: AdjContainer<T>, type Item = &'a T;
fn contained_iter_neighbors(
&self,
index: usize
) -> NContainedIter<'_, T, NodeContainer<T>>ⓘNotable traits for NContainedIter<'a, T, A>impl<'a, T, A> Iterator for NContainedIter<'a, T, A> where
T: 'a + Node,
A: AdjContainer<T>, type Item = &'a T;
impl<'a, T, A> Iterator for NContainedIter<'a, T, A> where
T: 'a + Node,
A: AdjContainer<T>, type Item = &'a T;
index
&T
sort_adj
will affect the order
AdjContainer<Node>
, i.e., A
fn container_iter_neighbors(
&self,
index: usize
) -> NContainerIter<'_, T, NodeContainer<T>>ⓘNotable traits for NContainerIter<'a, T, A>impl<'a, T, A> Iterator for NContainerIter<'a, T, A> where
T: 'a + Node,
A: AdjContainer<T>, type Item = &'a A;
fn container_iter_neighbors(
&self,
index: usize
) -> NContainerIter<'_, T, NodeContainer<T>>ⓘNotable traits for NContainerIter<'a, T, A>impl<'a, T, A> Iterator for NContainerIter<'a, T, A> where
T: 'a + Node,
A: AdjContainer<T>, type Item = &'a A;
impl<'a, T, A> Iterator for NContainerIter<'a, T, A> where
T: 'a + Node,
A: AdjContainer<T>, type Item = &'a A;
index
&T
sort_adj
will affect the orderfn contained_iter_neighbors_with_index(
&self,
index: usize
) -> NIContainedIter<'_, T, NodeContainer<T>>ⓘNotable traits for NIContainedIter<'a, T, A>impl<'a, T, A> Iterator for NIContainedIter<'a, T, A> where
T: 'a + Node,
A: AdjContainer<T>, type Item = (usize, &'a T);
fn contained_iter_neighbors_with_index(
&self,
index: usize
) -> NIContainedIter<'_, T, NodeContainer<T>>ⓘNotable traits for NIContainedIter<'a, T, A>impl<'a, T, A> Iterator for NIContainedIter<'a, T, A> where
T: 'a + Node,
A: AdjContainer<T>, type Item = (usize, &'a T);
impl<'a, T, A> Iterator for NIContainedIter<'a, T, A> where
T: 'a + Node,
A: AdjContainer<T>, type Item = (usize, &'a T);
index
index_neighbor
,&T
)sort_adj
will affect the orderreturns Iterator
Read more
fn dfs_with_index(&self, index: usize) -> DfsWithIndex<'_, T, NodeContainer<T>>ⓘNotable traits for DfsWithIndex<'a, T, A>impl<'a, T, A> Iterator for DfsWithIndex<'a, T, A> where
T: 'a,
A: AdjContainer<T>, type Item = (usize, &'a T);
fn dfs_with_index(&self, index: usize) -> DfsWithIndex<'_, T, NodeContainer<T>>ⓘNotable traits for DfsWithIndex<'a, T, A>impl<'a, T, A> Iterator for DfsWithIndex<'a, T, A> where
T: 'a,
A: AdjContainer<T>, type Item = (usize, &'a T);
impl<'a, T, A> Iterator for DfsWithIndex<'a, T, A> where
T: 'a,
A: AdjContainer<T>, type Item = (usize, &'a T);
returns Iterator
Read more
impl<T, E> GraphIterators<T, GenericGraph<T, SwContainer<T>>, SwContainer<T>> for E where
T: Node,
E: WithGraph<T, GenericGraph<T, SwContainer<T>>>,
impl<T, E> GraphIterators<T, GenericGraph<T, SwContainer<T>>, SwContainer<T>> for E where
T: Node,
E: WithGraph<T, GenericGraph<T, SwContainer<T>>>,
fn contained_iter(&self) -> ContainedIter<'_, T, SwContainer<T>>ⓘNotable traits for ContainedIter<'a, T, A>impl<'a, T, A> Iterator for ContainedIter<'a, T, A> where
T: 'a + Node,
A: AdjContainer<T>, type Item = &'a T;
fn contained_iter(&self) -> ContainedIter<'_, T, SwContainer<T>>ⓘNotable traits for ContainedIter<'a, T, A>impl<'a, T, A> Iterator for ContainedIter<'a, T, A> where
T: 'a + Node,
A: AdjContainer<T>, type Item = &'a T;
impl<'a, T, A> Iterator for ContainedIter<'a, T, A> where
T: 'a + Node,
A: AdjContainer<T>, type Item = &'a T;
Node
(for example EmptyNode
or whatever you used)self.container_iter().map(|container| container.contained())
fn contained_iter_neighbors(
&self,
index: usize
) -> NContainedIter<'_, T, SwContainer<T>>ⓘNotable traits for NContainedIter<'a, T, A>impl<'a, T, A> Iterator for NContainedIter<'a, T, A> where
T: 'a + Node,
A: AdjContainer<T>, type Item = &'a T;
fn contained_iter_neighbors(
&self,
index: usize
) -> NContainedIter<'_, T, SwContainer<T>>ⓘNotable traits for NContainedIter<'a, T, A>impl<'a, T, A> Iterator for NContainedIter<'a, T, A> where
T: 'a + Node,
A: AdjContainer<T>, type Item = &'a T;
impl<'a, T, A> Iterator for NContainedIter<'a, T, A> where
T: 'a + Node,
A: AdjContainer<T>, type Item = &'a T;
index
&T
sort_adj
will affect the order
AdjContainer<Node>
, i.e., A
fn container_iter_neighbors(
&self,
index: usize
) -> NContainerIter<'_, T, SwContainer<T>>ⓘNotable traits for NContainerIter<'a, T, A>impl<'a, T, A> Iterator for NContainerIter<'a, T, A> where
T: 'a + Node,
A: AdjContainer<T>, type Item = &'a A;
fn container_iter_neighbors(
&self,
index: usize
) -> NContainerIter<'_, T, SwContainer<T>>ⓘNotable traits for NContainerIter<'a, T, A>impl<'a, T, A> Iterator for NContainerIter<'a, T, A> where
T: 'a + Node,
A: AdjContainer<T>, type Item = &'a A;
impl<'a, T, A> Iterator for NContainerIter<'a, T, A> where
T: 'a + Node,
A: AdjContainer<T>, type Item = &'a A;
index
&T
sort_adj
will affect the orderfn contained_iter_neighbors_with_index(
&self,
index: usize
) -> NIContainedIter<'_, T, SwContainer<T>>ⓘNotable traits for NIContainedIter<'a, T, A>impl<'a, T, A> Iterator for NIContainedIter<'a, T, A> where
T: 'a + Node,
A: AdjContainer<T>, type Item = (usize, &'a T);
fn contained_iter_neighbors_with_index(
&self,
index: usize
) -> NIContainedIter<'_, T, SwContainer<T>>ⓘNotable traits for NIContainedIter<'a, T, A>impl<'a, T, A> Iterator for NIContainedIter<'a, T, A> where
T: 'a + Node,
A: AdjContainer<T>, type Item = (usize, &'a T);
impl<'a, T, A> Iterator for NIContainedIter<'a, T, A> where
T: 'a + Node,
A: AdjContainer<T>, type Item = (usize, &'a T);
index
index_neighbor
,&T
)sort_adj
will affect the orderreturns Iterator
Read more
fn dfs_with_index(&self, index: usize) -> DfsWithIndex<'_, T, SwContainer<T>>ⓘNotable traits for DfsWithIndex<'a, T, A>impl<'a, T, A> Iterator for DfsWithIndex<'a, T, A> where
T: 'a,
A: AdjContainer<T>, type Item = (usize, &'a T);
fn dfs_with_index(&self, index: usize) -> DfsWithIndex<'_, T, SwContainer<T>>ⓘNotable traits for DfsWithIndex<'a, T, A>impl<'a, T, A> Iterator for DfsWithIndex<'a, T, A> where
T: 'a,
A: AdjContainer<T>, type Item = (usize, &'a T);
impl<'a, T, A> Iterator for DfsWithIndex<'a, T, A> where
T: 'a,
A: AdjContainer<T>, type Item = (usize, &'a T);
returns Iterator
Read more
impl<T, R> GraphIterators<T, GenericGraph<T, WSContainer<T>>, WSContainer<T>> for SmallWorldWS<T, R> where
T: Node + SerdeStateConform,
R: Rng,
impl<T, R> GraphIterators<T, GenericGraph<T, WSContainer<T>>, WSContainer<T>> for SmallWorldWS<T, R> where
T: Node + SerdeStateConform,
R: Rng,
fn contained_iter(&self) -> ContainedIter<'_, T, WSContainer<T>>ⓘNotable traits for ContainedIter<'a, T, A>impl<'a, T, A> Iterator for ContainedIter<'a, T, A> where
T: 'a + Node,
A: AdjContainer<T>, type Item = &'a T;
fn contained_iter(&self) -> ContainedIter<'_, T, WSContainer<T>>ⓘNotable traits for ContainedIter<'a, T, A>impl<'a, T, A> Iterator for ContainedIter<'a, T, A> where
T: 'a + Node,
A: AdjContainer<T>, type Item = &'a T;
impl<'a, T, A> Iterator for ContainedIter<'a, T, A> where
T: 'a + Node,
A: AdjContainer<T>, type Item = &'a T;
Node
(for example EmptyNode
or whatever you used)self.container_iter().map(|container| container.contained())
fn contained_iter_neighbors(
&self,
index: usize
) -> NContainedIter<'_, T, WSContainer<T>>ⓘNotable traits for NContainedIter<'a, T, A>impl<'a, T, A> Iterator for NContainedIter<'a, T, A> where
T: 'a + Node,
A: AdjContainer<T>, type Item = &'a T;
fn contained_iter_neighbors(
&self,
index: usize
) -> NContainedIter<'_, T, WSContainer<T>>ⓘNotable traits for NContainedIter<'a, T, A>impl<'a, T, A> Iterator for NContainedIter<'a, T, A> where
T: 'a + Node,
A: AdjContainer<T>, type Item = &'a T;
impl<'a, T, A> Iterator for NContainedIter<'a, T, A> where
T: 'a + Node,
A: AdjContainer<T>, type Item = &'a T;
index
&T
sort_adj
will affect the orderfn contained_iter_neighbors_with_index(
&self,
index: usize
) -> NIContainedIter<'_, T, WSContainer<T>>ⓘNotable traits for NIContainedIter<'a, T, A>impl<'a, T, A> Iterator for NIContainedIter<'a, T, A> where
T: 'a + Node,
A: AdjContainer<T>, type Item = (usize, &'a T);
fn contained_iter_neighbors_with_index(
&self,
index: usize
) -> NIContainedIter<'_, T, WSContainer<T>>ⓘNotable traits for NIContainedIter<'a, T, A>impl<'a, T, A> Iterator for NIContainedIter<'a, T, A> where
T: 'a + Node,
A: AdjContainer<T>, type Item = (usize, &'a T);
impl<'a, T, A> Iterator for NIContainedIter<'a, T, A> where
T: 'a + Node,
A: AdjContainer<T>, type Item = (usize, &'a T);
index
index_neighbor
,&T
)sort_adj
will affect the order
AdjContainer<Node>
, i.e., A
fn container_iter_neighbors(
&self,
index: usize
) -> NContainerIter<'_, T, WSContainer<T>>ⓘNotable traits for NContainerIter<'a, T, A>impl<'a, T, A> Iterator for NContainerIter<'a, T, A> where
T: 'a + Node,
A: AdjContainer<T>, type Item = &'a A;
fn container_iter_neighbors(
&self,
index: usize
) -> NContainerIter<'_, T, WSContainer<T>>ⓘNotable traits for NContainerIter<'a, T, A>impl<'a, T, A> Iterator for NContainerIter<'a, T, A> where
T: 'a + Node,
A: AdjContainer<T>, type Item = &'a A;
impl<'a, T, A> Iterator for NContainerIter<'a, T, A> where
T: 'a + Node,
A: AdjContainer<T>, type Item = &'a A;
index
&T
sort_adj
will affect the orderreturns Iterator
Read more
fn dfs_with_index(&self, index: usize) -> DfsWithIndex<'_, T, WSContainer<T>>ⓘNotable traits for DfsWithIndex<'a, T, A>impl<'a, T, A> Iterator for DfsWithIndex<'a, T, A> where
T: 'a,
A: AdjContainer<T>, type Item = (usize, &'a T);
fn dfs_with_index(&self, index: usize) -> DfsWithIndex<'_, T, WSContainer<T>>ⓘNotable traits for DfsWithIndex<'a, T, A>impl<'a, T, A> Iterator for DfsWithIndex<'a, T, A> where
T: 'a,
A: AdjContainer<T>, type Item = (usize, &'a T);
impl<'a, T, A> Iterator for DfsWithIndex<'a, T, A> where
T: 'a,
A: AdjContainer<T>, type Item = (usize, &'a T);
returns Iterator
Read more
impl<T, R> GraphIteratorsMut<T, GenericGraph<T, NodeContainer<T>>, NodeContainer<T>> for ErEnsembleC<T, R> where
T: Node + SerdeStateConform,
R: Rng,
impl<T, R> GraphIteratorsMut<T, GenericGraph<T, NodeContainer<T>>, NodeContainer<T>> for ErEnsembleC<T, R> where
T: Node + SerdeStateConform,
R: Rng,
fn contained_iter_neighbors_mut(
&mut self,
index: usize
) -> NContainedIterMut<'_, T, NodeContainer<T>>ⓘNotable traits for NContainedIterMut<'a, T, A>impl<'a, T, A> Iterator for NContainedIterMut<'a, T, A> where
T: 'a + Node,
A: AdjContainer<T>, type Item = &'a mut T;
fn contained_iter_neighbors_mut(
&mut self,
index: usize
) -> NContainedIterMut<'_, T, NodeContainer<T>>ⓘNotable traits for NContainedIterMut<'a, T, A>impl<'a, T, A> Iterator for NContainedIterMut<'a, T, A> where
T: 'a + Node,
A: AdjContainer<T>, type Item = &'a mut T;
impl<'a, T, A> Iterator for NContainedIterMut<'a, T, A> where
T: 'a + Node,
A: AdjContainer<T>, type Item = &'a mut T;
index
&mut T
sort_adj
will affect the orderfn contained_iter_neighbors_mut_with_index(
&mut self,
index: usize
) -> INContainedIterMut<'_, T, NodeContainer<T>>ⓘNotable traits for INContainedIterMut<'a, T, A>impl<'a, T, A> Iterator for INContainedIterMut<'a, T, A> where
T: 'a + Node,
A: AdjContainer<T>, type Item = (usize, &'a mut T);
fn contained_iter_neighbors_mut_with_index(
&mut self,
index: usize
) -> INContainedIterMut<'_, T, NodeContainer<T>>ⓘNotable traits for INContainedIterMut<'a, T, A>impl<'a, T, A> Iterator for INContainedIterMut<'a, T, A> where
T: 'a + Node,
A: AdjContainer<T>, type Item = (usize, &'a mut T);
impl<'a, T, A> Iterator for INContainedIterMut<'a, T, A> where
T: 'a + Node,
A: AdjContainer<T>, type Item = (usize, &'a mut T);
index
(index_neighbor: usize, neighbor: &mut T)
sort_adj
will affect the orderfn contained_iter_mut(&mut self) -> ContainedIterMut<'_, T, NodeContainer<T>>ⓘNotable traits for ContainedIterMut<'a, T, A>impl<'a, T, A> Iterator for ContainedIterMut<'a, T, A> where
T: 'a + Node,
A: AdjContainer<T>, type Item = &'a mut T;
fn contained_iter_mut(&mut self) -> ContainedIterMut<'_, T, NodeContainer<T>>ⓘNotable traits for ContainedIterMut<'a, T, A>impl<'a, T, A> Iterator for ContainedIterMut<'a, T, A> where
T: 'a + Node,
A: AdjContainer<T>, type Item = &'a mut T;
impl<'a, T, A> Iterator for ContainedIterMut<'a, T, A> where
T: 'a + Node,
A: AdjContainer<T>, type Item = &'a mut T;
Node
(for example EmptyNode
or whatever you used)impl<T, R> GraphIteratorsMut<T, GenericGraph<T, NodeContainer<T>>, NodeContainer<T>> for ErEnsembleM<T, R> where
T: Node + SerdeStateConform,
R: Rng,
impl<T, R> GraphIteratorsMut<T, GenericGraph<T, NodeContainer<T>>, NodeContainer<T>> for ErEnsembleM<T, R> where
T: Node + SerdeStateConform,
R: Rng,
fn contained_iter_neighbors_mut(
&mut self,
index: usize
) -> NContainedIterMut<'_, T, NodeContainer<T>>ⓘNotable traits for NContainedIterMut<'a, T, A>impl<'a, T, A> Iterator for NContainedIterMut<'a, T, A> where
T: 'a + Node,
A: AdjContainer<T>, type Item = &'a mut T;
fn contained_iter_neighbors_mut(
&mut self,
index: usize
) -> NContainedIterMut<'_, T, NodeContainer<T>>ⓘNotable traits for NContainedIterMut<'a, T, A>impl<'a, T, A> Iterator for NContainedIterMut<'a, T, A> where
T: 'a + Node,
A: AdjContainer<T>, type Item = &'a mut T;
impl<'a, T, A> Iterator for NContainedIterMut<'a, T, A> where
T: 'a + Node,
A: AdjContainer<T>, type Item = &'a mut T;
index
&mut T
sort_adj
will affect the orderfn contained_iter_neighbors_mut_with_index(
&mut self,
index: usize
) -> INContainedIterMut<'_, T, NodeContainer<T>>ⓘNotable traits for INContainedIterMut<'a, T, A>impl<'a, T, A> Iterator for INContainedIterMut<'a, T, A> where
T: 'a + Node,
A: AdjContainer<T>, type Item = (usize, &'a mut T);
fn contained_iter_neighbors_mut_with_index(
&mut self,
index: usize
) -> INContainedIterMut<'_, T, NodeContainer<T>>ⓘNotable traits for INContainedIterMut<'a, T, A>impl<'a, T, A> Iterator for INContainedIterMut<'a, T, A> where
T: 'a + Node,
A: AdjContainer<T>, type Item = (usize, &'a mut T);
impl<'a, T, A> Iterator for INContainedIterMut<'a, T, A> where
T: 'a + Node,
A: AdjContainer<T>, type Item = (usize, &'a mut T);
index
(index_neighbor: usize, neighbor: &mut T)
sort_adj
will affect the orderfn contained_iter_mut(&mut self) -> ContainedIterMut<'_, T, NodeContainer<T>>ⓘNotable traits for ContainedIterMut<'a, T, A>impl<'a, T, A> Iterator for ContainedIterMut<'a, T, A> where
T: 'a + Node,
A: AdjContainer<T>, type Item = &'a mut T;
fn contained_iter_mut(&mut self) -> ContainedIterMut<'_, T, NodeContainer<T>>ⓘNotable traits for ContainedIterMut<'a, T, A>impl<'a, T, A> Iterator for ContainedIterMut<'a, T, A> where
T: 'a + Node,
A: AdjContainer<T>, type Item = &'a mut T;
impl<'a, T, A> Iterator for ContainedIterMut<'a, T, A> where
T: 'a + Node,
A: AdjContainer<T>, type Item = &'a mut T;
Node
(for example EmptyNode
or whatever you used)impl<T, R> GraphIteratorsMut<T, GenericGraph<T, NodeContainer<T>>, NodeContainer<T>> for BAensemble<T, R> where
T: Node + SerdeStateConform,
R: Rng,
impl<T, R> GraphIteratorsMut<T, GenericGraph<T, NodeContainer<T>>, NodeContainer<T>> for BAensemble<T, R> where
T: Node + SerdeStateConform,
R: Rng,
fn contained_iter_neighbors_mut(
&mut self,
index: usize
) -> NContainedIterMut<'_, T, NodeContainer<T>>ⓘNotable traits for NContainedIterMut<'a, T, A>impl<'a, T, A> Iterator for NContainedIterMut<'a, T, A> where
T: 'a + Node,
A: AdjContainer<T>, type Item = &'a mut T;
fn contained_iter_neighbors_mut(
&mut self,
index: usize
) -> NContainedIterMut<'_, T, NodeContainer<T>>ⓘNotable traits for NContainedIterMut<'a, T, A>impl<'a, T, A> Iterator for NContainedIterMut<'a, T, A> where
T: 'a + Node,
A: AdjContainer<T>, type Item = &'a mut T;
impl<'a, T, A> Iterator for NContainedIterMut<'a, T, A> where
T: 'a + Node,
A: AdjContainer<T>, type Item = &'a mut T;
index
&mut T
sort_adj
will affect the orderfn contained_iter_neighbors_mut_with_index(
&mut self,
index: usize
) -> INContainedIterMut<'_, T, NodeContainer<T>>ⓘNotable traits for INContainedIterMut<'a, T, A>impl<'a, T, A> Iterator for INContainedIterMut<'a, T, A> where
T: 'a + Node,
A: AdjContainer<T>, type Item = (usize, &'a mut T);
fn contained_iter_neighbors_mut_with_index(
&mut self,
index: usize
) -> INContainedIterMut<'_, T, NodeContainer<T>>ⓘNotable traits for INContainedIterMut<'a, T, A>impl<'a, T, A> Iterator for INContainedIterMut<'a, T, A> where
T: 'a + Node,
A: AdjContainer<T>, type Item = (usize, &'a mut T);
impl<'a, T, A> Iterator for INContainedIterMut<'a, T, A> where
T: 'a + Node,
A: AdjContainer<T>, type Item = (usize, &'a mut T);
index
(index_neighbor: usize, neighbor: &mut T)
sort_adj
will affect the orderfn contained_iter_mut(&mut self) -> ContainedIterMut<'_, T, NodeContainer<T>>ⓘNotable traits for ContainedIterMut<'a, T, A>impl<'a, T, A> Iterator for ContainedIterMut<'a, T, A> where
T: 'a + Node,
A: AdjContainer<T>, type Item = &'a mut T;
fn contained_iter_mut(&mut self) -> ContainedIterMut<'_, T, NodeContainer<T>>ⓘNotable traits for ContainedIterMut<'a, T, A>impl<'a, T, A> Iterator for ContainedIterMut<'a, T, A> where
T: 'a + Node,
A: AdjContainer<T>, type Item = &'a mut T;
impl<'a, T, A> Iterator for ContainedIterMut<'a, T, A> where
T: 'a + Node,
A: AdjContainer<T>, type Item = &'a mut T;
Node
(for example EmptyNode
or whatever you used)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,
fn contained_iter_neighbors_mut(
&mut self,
index: usize
) -> NContainedIterMut<'_, T, NodeContainer<T>>ⓘNotable traits for NContainedIterMut<'a, T, A>impl<'a, T, A> Iterator for NContainedIterMut<'a, T, A> where
T: 'a + Node,
A: AdjContainer<T>, type Item = &'a mut T;
fn contained_iter_neighbors_mut(
&mut self,
index: usize
) -> NContainedIterMut<'_, T, NodeContainer<T>>ⓘNotable traits for NContainedIterMut<'a, T, A>impl<'a, T, A> Iterator for NContainedIterMut<'a, T, A> where
T: 'a + Node,
A: AdjContainer<T>, type Item = &'a mut T;
impl<'a, T, A> Iterator for NContainedIterMut<'a, T, A> where
T: 'a + Node,
A: AdjContainer<T>, type Item = &'a mut T;
index
&mut T
sort_adj
will affect the orderfn contained_iter_neighbors_mut_with_index(
&mut self,
index: usize
) -> INContainedIterMut<'_, T, NodeContainer<T>>ⓘNotable traits for INContainedIterMut<'a, T, A>impl<'a, T, A> Iterator for INContainedIterMut<'a, T, A> where
T: 'a + Node,
A: AdjContainer<T>, type Item = (usize, &'a mut T);
fn contained_iter_neighbors_mut_with_index(
&mut self,
index: usize
) -> INContainedIterMut<'_, T, NodeContainer<T>>ⓘNotable traits for INContainedIterMut<'a, T, A>impl<'a, T, A> Iterator for INContainedIterMut<'a, T, A> where
T: 'a + Node,
A: AdjContainer<T>, type Item = (usize, &'a mut T);
impl<'a, T, A> Iterator for INContainedIterMut<'a, T, A> where
T: 'a + Node,
A: AdjContainer<T>, type Item = (usize, &'a mut T);
index
(index_neighbor: usize, neighbor: &mut T)
sort_adj
will affect the orderfn contained_iter_mut(&mut self) -> ContainedIterMut<'_, T, NodeContainer<T>>ⓘNotable traits for ContainedIterMut<'a, T, A>impl<'a, T, A> Iterator for ContainedIterMut<'a, T, A> where
T: 'a + Node,
A: AdjContainer<T>, type Item = &'a mut T;
fn contained_iter_mut(&mut self) -> ContainedIterMut<'_, T, NodeContainer<T>>ⓘNotable traits for ContainedIterMut<'a, T, A>impl<'a, T, A> Iterator for ContainedIterMut<'a, T, A> where
T: 'a + Node,
A: AdjContainer<T>, type Item = &'a mut T;
impl<'a, T, A> Iterator for ContainedIterMut<'a, T, A> where
T: 'a + Node,
A: AdjContainer<T>, type Item = &'a mut T;
Node
(for example EmptyNode
or whatever you used)impl<T, R> GraphIteratorsMut<T, GenericGraph<T, SwContainer<T>>, SwContainer<T>> for SwEnsemble<T, R> where
T: Node + SerdeStateConform,
R: Rng,
impl<T, R> GraphIteratorsMut<T, GenericGraph<T, SwContainer<T>>, SwContainer<T>> for SwEnsemble<T, R> where
T: Node + SerdeStateConform,
R: Rng,
fn contained_iter_neighbors_mut(
&mut self,
index: usize
) -> NContainedIterMut<'_, T, SwContainer<T>>ⓘNotable traits for NContainedIterMut<'a, T, A>impl<'a, T, A> Iterator for NContainedIterMut<'a, T, A> where
T: 'a + Node,
A: AdjContainer<T>, type Item = &'a mut T;
fn contained_iter_neighbors_mut(
&mut self,
index: usize
) -> NContainedIterMut<'_, T, SwContainer<T>>ⓘNotable traits for NContainedIterMut<'a, T, A>impl<'a, T, A> Iterator for NContainedIterMut<'a, T, A> where
T: 'a + Node,
A: AdjContainer<T>, type Item = &'a mut T;
impl<'a, T, A> Iterator for NContainedIterMut<'a, T, A> where
T: 'a + Node,
A: AdjContainer<T>, type Item = &'a mut T;
index
&mut T
sort_adj
will affect the orderfn contained_iter_neighbors_mut_with_index(
&mut self,
index: usize
) -> INContainedIterMut<'_, T, SwContainer<T>>ⓘNotable traits for INContainedIterMut<'a, T, A>impl<'a, T, A> Iterator for INContainedIterMut<'a, T, A> where
T: 'a + Node,
A: AdjContainer<T>, type Item = (usize, &'a mut T);
fn contained_iter_neighbors_mut_with_index(
&mut self,
index: usize
) -> INContainedIterMut<'_, T, SwContainer<T>>ⓘNotable traits for INContainedIterMut<'a, T, A>impl<'a, T, A> Iterator for INContainedIterMut<'a, T, A> where
T: 'a + Node,
A: AdjContainer<T>, type Item = (usize, &'a mut T);
impl<'a, T, A> Iterator for INContainedIterMut<'a, T, A> where
T: 'a + Node,
A: AdjContainer<T>, type Item = (usize, &'a mut T);
index
(index_neighbor: usize, neighbor: &mut T)
sort_adj
will affect the orderfn contained_iter_mut(&mut self) -> ContainedIterMut<'_, T, SwContainer<T>>ⓘNotable traits for ContainedIterMut<'a, T, A>impl<'a, T, A> Iterator for ContainedIterMut<'a, T, A> where
T: 'a + Node,
A: AdjContainer<T>, type Item = &'a mut T;
fn contained_iter_mut(&mut self) -> ContainedIterMut<'_, T, SwContainer<T>>ⓘNotable traits for ContainedIterMut<'a, T, A>impl<'a, T, A> Iterator for ContainedIterMut<'a, T, A> where
T: 'a + Node,
A: AdjContainer<T>, type Item = &'a mut T;
impl<'a, T, A> Iterator for ContainedIterMut<'a, T, A> where
T: 'a + Node,
A: AdjContainer<T>, type Item = &'a mut T;
Node
(for example EmptyNode
or whatever you used)impl<T, R> GraphIteratorsMut<T, GenericGraph<T, WSContainer<T>>, WSContainer<T>> for SmallWorldWS<T, R> where
T: Node + SerdeStateConform,
R: Rng,
impl<T, R> GraphIteratorsMut<T, GenericGraph<T, WSContainer<T>>, WSContainer<T>> for SmallWorldWS<T, R> where
T: Node + SerdeStateConform,
R: Rng,
fn contained_iter_neighbors_mut(
&mut self,
index: usize
) -> NContainedIterMut<'_, T, WSContainer<T>>ⓘNotable traits for NContainedIterMut<'a, T, A>impl<'a, T, A> Iterator for NContainedIterMut<'a, T, A> where
T: 'a + Node,
A: AdjContainer<T>, type Item = &'a mut T;
fn contained_iter_neighbors_mut(
&mut self,
index: usize
) -> NContainedIterMut<'_, T, WSContainer<T>>ⓘNotable traits for NContainedIterMut<'a, T, A>impl<'a, T, A> Iterator for NContainedIterMut<'a, T, A> where
T: 'a + Node,
A: AdjContainer<T>, type Item = &'a mut T;
impl<'a, T, A> Iterator for NContainedIterMut<'a, T, A> where
T: 'a + Node,
A: AdjContainer<T>, type Item = &'a mut T;
index
&mut T
sort_adj
will affect the orderfn contained_iter_neighbors_mut_with_index(
&mut self,
index: usize
) -> INContainedIterMut<'_, T, WSContainer<T>>ⓘNotable traits for INContainedIterMut<'a, T, A>impl<'a, T, A> Iterator for INContainedIterMut<'a, T, A> where
T: 'a + Node,
A: AdjContainer<T>, type Item = (usize, &'a mut T);
fn contained_iter_neighbors_mut_with_index(
&mut self,
index: usize
) -> INContainedIterMut<'_, T, WSContainer<T>>ⓘNotable traits for INContainedIterMut<'a, T, A>impl<'a, T, A> Iterator for INContainedIterMut<'a, T, A> where
T: 'a + Node,
A: AdjContainer<T>, type Item = (usize, &'a mut T);
impl<'a, T, A> Iterator for INContainedIterMut<'a, T, A> where
T: 'a + Node,
A: AdjContainer<T>, type Item = (usize, &'a mut T);
index
(index_neighbor: usize, neighbor: &mut T)
sort_adj
will affect the orderfn contained_iter_mut(&mut self) -> ContainedIterMut<'_, T, WSContainer<T>>ⓘNotable traits for ContainedIterMut<'a, T, A>impl<'a, T, A> Iterator for ContainedIterMut<'a, T, A> where
T: 'a + Node,
A: AdjContainer<T>, type Item = &'a mut T;
fn contained_iter_mut(&mut self) -> ContainedIterMut<'_, T, WSContainer<T>>ⓘNotable traits for ContainedIterMut<'a, T, A>impl<'a, T, A> Iterator for ContainedIterMut<'a, T, A> where
T: 'a + Node,
A: AdjContainer<T>, type Item = &'a mut T;
impl<'a, T, A> Iterator for ContainedIterMut<'a, T, A> where
T: 'a + Node,
A: AdjContainer<T>, type Item = &'a mut T;
Node
(for example EmptyNode
or whatever you used)impl<T, A, E> MeasurableGraphQuantities<GenericGraph<T, A>> for E where
T: Node,
A: AdjContainer<T>,
GenericGraph<T, A>: Clone,
E: AsRef<GenericGraph<T, A>>,
impl<T, A, E> MeasurableGraphQuantities<GenericGraph<T, A>> for E where
T: Node,
A: AdjContainer<T>,
GenericGraph<T, A>: Clone,
E: AsRef<GenericGraph<T, A>>,
calculates the average degree of the graph Read more
compute sizes of all connected components Read more
None
if graph not connected or does not contain any verticesreturns total number of edges in graph
Count number of leaves in the graph, i.e. vertices with exactly one neighbor
calculate the size of the longest shortest path starting from vertex with index index
using breadth first search Read more
Calculates transitivity of graph Read more
calculate sizes of all binode connected components Read more
returns number of vertices present in graph
impl<T, R> WithGraph<T, GenericGraph<T, NodeContainer<T>>> for ErEnsembleC<T, R> where
T: Node + SerdeStateConform,
R: Rng,
impl<T, R> WithGraph<T, GenericGraph<T, NodeContainer<T>>> for ErEnsembleC<T, R> where
T: Node + SerdeStateConform,
R: Rng,
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
impl<T, R> WithGraph<T, GenericGraph<T, NodeContainer<T>>> for ErEnsembleM<T, R> where
T: Node + SerdeStateConform,
R: Rng,
impl<T, R> WithGraph<T, GenericGraph<T, NodeContainer<T>>> for ErEnsembleM<T, R> where
T: Node + SerdeStateConform,
R: Rng,
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
impl<T, R> WithGraph<T, GenericGraph<T, NodeContainer<T>>> for BAensemble<T, R> where
T: Node + SerdeStateConform,
R: Rng,
impl<T, R> WithGraph<T, GenericGraph<T, NodeContainer<T>>> for BAensemble<T, R> where
T: Node + SerdeStateConform,
R: Rng,
GenericGraph
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,
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
impl<T, R> WithGraph<T, GenericGraph<T, SwContainer<T>>> for SwEnsemble<T, R> where
T: Node + SerdeStateConform,
R: Rng,
impl<T, R> WithGraph<T, GenericGraph<T, SwContainer<T>>> for SwEnsemble<T, R> where
T: Node + SerdeStateConform,
R: Rng,
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
GenericGraph
Auto Trait Implementations
impl<T, A> RefUnwindSafe for GenericGraph<T, A> where
A: RefUnwindSafe,
T: RefUnwindSafe,
impl<T, A> Send for GenericGraph<T, A> where
A: Send,
T: Send,
impl<T, A> Sync for GenericGraph<T, A> where
A: Sync,
T: Sync,
impl<T, A> Unpin for GenericGraph<T, A> where
A: Unpin,
T: Unpin,
impl<T, A> UnwindSafe for GenericGraph<T, A> where
A: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more
pub fn cast_trunc(self) -> T
pub fn cast_trunc(self) -> T
Cast to integer, truncating Read more
pub fn cast_nearest(self) -> T
pub fn cast_nearest(self) -> T
Cast to the nearest integer Read more
pub fn cast_floor(self) -> T
pub fn cast_floor(self) -> T
Cast the floor to an integer Read more
pub fn try_cast_trunc(self) -> Result<T, Error>
pub fn try_cast_trunc(self) -> Result<T, Error>
Try converting to integer with truncation Read more
pub fn try_cast_nearest(self) -> Result<T, Error>
pub fn try_cast_nearest(self) -> Result<T, Error>
Try converting to the nearest integer Read more
pub fn try_cast_floor(self) -> Result<T, Error>
pub fn try_cast_floor(self) -> Result<T, Error>
Try converting the floor to an integer Read more
pub fn try_cast_ceil(self) -> Result<T, Error>
pub fn try_cast_ceil(self) -> Result<T, Error>
Try convert the ceiling to an integer Read more