circular_graph#
- graph_tool.generation.circular_graph(N, k=1, self_loops=False, directed=False)[source]#
Generate a circular graph.
- Parameters:
- N
int
Number of vertices.
- k
int
(optional, default:True
) Number of nearest neighbors to be connected.
- self_loopsbool (optional, default:
False
) If
True
, self-loops are included.- directedbool (optional, default:
False
) If
True
, a directed graph is generated.
- N
- Returns:
- circular_graph
Graph
A circular graph.
- circular_graph
Examples
>>> g = gt.circular_graph(30, 2) >>> pos = gt.sfdp_layout(g, cooling_step=0.95) >>> gt.graph_draw(g, pos=pos, output="circular.pdf") <...>