GraphTheory[CycleGraph]
GraphTheory[PathGraph]
|
Calling Sequence
|
|
CycleGraph(n)
CycleGraph(V)
PathGraph(n)
PathGraph(V)
|
|
Parameters
|
|
n
|
-
|
positive integer
|
V
|
-
|
list of vertices
|
|
|
|
|
Description
|
|
•
|
CycleGraph(n) outputs a graph which is a cycle on n vertices labeled 1, 2, ..., n.
|
•
|
PathGraph(n) outputs a graph which is a path on n vertices, labeled 1, 2, ..., n.
|
•
|
In both cases you may input the labels for the vertices as a list of integers, strings or symbols.
|
|
|
Examples
|
|
>
|
|
>
|
|
| (1) |
>
|
|
| (2) |
>
|
|
>
|
|
| (3) |
>
|
|
| (4) |
>
|
|
|
|
Download Help Document
Was this information helpful?