circular_graph#
- graph_tool.generation.circular_graph(N, k=1, self_loops=False, directed=False)[git][source]#
Generate a circular graph.
- Parameters:
- N
int Number of vertices.
- k
int(optional, default:1) 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
See also
named_graphAlso gives this graph, as
named_graph("circular", ...), with the other named graphs and deterministic families
Examples
>>> g = gt.circular_graph(30, 2) >>> pos = gt.hfd_layout(g) >>> gt.graph_draw(g, pos=pos, output="circular.pdf") <...>
A circular graph with \(N=30\) vertices, and \(k=2\).#