hiperwalk.Cycle#
- hiperwalk.Cycle(num_vert, multiedges=None, weights=None)[source]#
Cycle graph.
- Parameters:
- num_vertint
Number of vertices in the cycle.
- multiedges, weights: scipy.sparse.csr_array, default=None
See Graph Constructors.
- Returns:
hiperwalk.Graph
See Graph Constructors for details.
See also
Notes
The cycle can be interpreted as being embedded on the line with a cyclic boundary condition. In this context, the order of neighbors is the neighbor to the right first, followed by the neighbor to the left. In other words, for any vertex \(v\), the neighbors are given in the order \([v + 1, v - 1]\).
>>> g = hpw.Cycle(10) >>> g.neighbors(0) array([1, 9]) >>> g.neighbors(1) array([2, 0]) >>> g.neighbors(8) array([9, 7]) >>> g.neighbors(9) array([0, 8])
Methods#
All methods are inherited from
hiperwalk.IntegerLattice
.