pub struct Network { /* private fields */ }
Expand description
§Definition of struct Network, the implementation of network in mathmatics.
Expression of network or graph is “The set of vertexes and the set of links which is pair of the vertex”.
I use this index rule: the vertex is denoted by number 0 ~ n-1, n as the amount of the vertexes.
So the expression of the struct Network becomes simple and smart.
Note : A famous way of the expression of network is adjacency matrix, but it use O(n^2) memory space.
I may prepare the access to the adjacency matrix bia function, but it is not inevitable.
Many of the calculation experiment program for the network dynamics like percolation is written with using edge list expression of the network, not adjacency matrix.
Implementations§
Source§impl Network
impl Network
Sourcepub fn make_square_lattice(length: u32) -> Network
pub fn make_square_lattice(length: u32) -> Network
Create square lattice.
Sourcepub fn make_regular_lattice(dim: u32, length: u32) -> Network
pub fn make_regular_lattice(dim: u32, length: u32) -> Network
Create regular lattice
Sourcepub fn make_regular_random_graph(n: u32, frac: f64, rng: &mut StdRng) -> Network
pub fn make_regular_random_graph(n: u32, frac: f64, rng: &mut StdRng) -> Network
create regular random graph
Sourcepub fn exist_self_loop(&self) -> bool
pub fn exist_self_loop(&self) -> bool
Check of the self loop Calculation time is O(L).
Sourcepub fn exist_multi_loop(&self) -> bool
pub fn exist_multi_loop(&self) -> bool
Check of the multi loop Caution : Calculation time is O(L^2), it can be vast time. Be careful.