1.8. igraph_ring — Creates a ring graph, a one dimensional lattice.

int igraph_ring(igraph_t *graph, igraph_integer_t n, igraph_bool_t directed, igraph_bool_t mutual,
		igraph_bool_t circular);

Arguments: 

graph:

Pointer to an uninitialized graph object.

n:

The number of vertices in the ring.

directed:

Logical, whether to create a directed ring.

mutual:

Logical, whether to create mutual edges in a directed ring. It is ignored for undirected graphs.

circular:

Logical, if false, the ring will be open (this is not a real ring actually).

Returns: 

Error code: IGRAPH_EINVAL: invalid number of vertices.

Time complexity: O(|V|), the number of vertices in the graph.

See also: 

igraph_lattice() for generating more general lattices.