rustworkx.random_layout#

random_layout(graph, center=None, seed=None)[source]#

Generate a random layout

Parameters:
  • graph (PyGraph) – The graph to generate the layout for

  • center (tuple) – An optional center position. This is a 2 tuple of two float values for the center position

  • seed (int) – An optional seed to set for the random number generator.

Returns:

The random layout of the graph.

Return type:

Pos2DMapping