Skip to main content
`Ctrl`+`K`

# vispy.visuals.graphs.layouts.random module

## Random Graph Layout

This layout positions the nodes at random

vispy.visuals.graphs.layouts.random.random(adjacency_mat, directed=False, random_state=None)

  Place the graph nodes at random places.

  Parameters:
    adjacency_mat matrix or sparse

      The graph adjacency matrix

    directed bool

      Whether the graph is directed. If this is True, is will also generate the vertices for arrows, which can be passed to an ArrowVisual.

    random_state instance of RandomState | int | None

      Random state to use. Can be None to use `np.random`.

  Yields:
    (node_vertices, line_vertices, arrow_vertices)tuple

      Yields the node and line vertices in a tuple. This layout only yields a single time, and has no builtin animation