Skip to content

Commit

Permalink
Update cycle.py
Browse files Browse the repository at this point in the history
  • Loading branch information
hiperwalk committed May 1, 2024
1 parent 32704be commit fa37f10
Showing 1 changed file with 1 addition and 49 deletions.
50 changes: 1 addition & 49 deletions hiperwalk/graph/cycle.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,55 +2,7 @@

def Cycle(num_vert, multiedges=None, weights=None):
r"""
Cycle graph.
Parameters
----------
num_vert : int
Number of vertices in the cycle.
multiedges, weights: scipy.sparse.csr_array, default=None
See :ref:`graph_constructors`.
Returns
-------
:class:`hiperwalk.Graph`
See :ref:`graph_constructors` for details.
See Also
--------
:ref:`graph_constructors`.
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 :math:`v`,
the neighbors are given in the order :math:`[v + 1, v - 1]`.
.. testsetup::
import hiperwalk as hpw
.. doctest::
>>> 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])
"""
def Cycle(num_vert, multiedges=None, weights=None):
r"""
Construct a cycle graph.
Cycle graph constructor.
A cycle graph is a graph that forms a single closed loop,
where each vertex is connected to exactly two other vertices,
Expand Down

0 comments on commit fa37f10

Please sign in to comment.