make_circulant: Create a circulant graph

View source: R/make.R

make_circulantR Documentation

Create a circulant graph

Description

A circulant graph C_n^{\textrm{shifts}} consists of n vertices v_0, \ldots, v_{n-1} such that for each s_i in the list of offsets shifts, v_j is connected to v_{(j + s_i) \mod n} for all j.

Usage

make_circulant(n, shifts, directed = FALSE)

circulant(n, shifts, directed = FALSE)

Arguments

n

Integer, the number of vertices in the circulant graph.

shifts

Integer vector, a list of the offsets within the circulant graph.

directed

Boolean, whether to create a directed graph.

Details

The function can generate either directed or undirected graphs. It does not generate multi-edges or self-loops.

Value

An igraph graph.

Related documentation in the C library

circulant()

See Also

Other deterministic constructors: graph_from_atlas(), graph_from_edgelist(), graph_from_literal(), make_(), make_chordal_ring(), make_empty_graph(), make_full_citation_graph(), make_full_graph(), make_full_multipartite(), make_graph(), make_lattice(), make_ring(), make_star(), make_tree(), make_turan(), make_wheel()

Examples

# Create a circulant graph with 10 vertices and shifts 1 and 3
g <- make_circulant(10, c(1, 3))
plot(g, layout = layout_in_circle)

# A directed circulant graph
g2 <- make_circulant(10, c(1, 3), directed = TRUE)
plot(g2, layout = layout_in_circle)

igraph documentation built on April 21, 2026, 5:06 p.m.