NetworkX

Previous topic

networkx.generators.classic.empty_graph

Next topic

networkx.generators.classic.grid_graph

networkx.generators.classic.grid_2d_graph

networkx.generators.classic.grid_2d_graph(m, n, periodic=False, create_using=None)

Return the 2d grid graph of mxn nodes, each connected to its nearest neighbors. Optional argument periodic=True will connect boundary nodes via periodic boundary conditions.