Regular ring lattice¶
- regular_ring_lattice[vert_type](size: int, degree: int) undirected_network[vert_type] ¶
-
template<integer_network_vertex VertT>
undirected_network<VertT> regular_ring_lattice(VertT size, VertT degree)¶
Generates a regular ring lattice of size size
and degree degree
. A
ring-like structure that if arranged in a circle, each vertex would be connected
to \(degree/2\) vertices before and after it.
The parameter degree
needs to be an even number and degree
needs
to be smaller than size
, otherwise the function fails by raising a
ValueError
exception in Python or a std::invalid_argument
exception
in C++.
>>> import reticula as ret
>>> ret.regular_ring_lattice[ret.int64](size=128, degree=6)
<undirected_network[int64] with 128 verts and 384 edges>