= `random_graph_layout`

Places the vertices of a graph at random locations within a given topology.

*Complexity:* _O(|V|)_ +
*Defined in:* `<boost/graph/random_layout.hpp>`

== Example

[source,cpp]
----
include::example$algorithms/layout/random_layout.cpp[]
----

[,text]
----
include::example$algorithms/layout/random_layout.txt[]
----

'''

=== Positional version

[source,cpp]
----
template<typename Graph, typename PositionMap, typename Topology>
void random_graph_layout(
    const Graph& g,
    PositionMap position_map,
    const Topology& space);
----

[cols="1,2,5"]
|===
| Direction | Parameter | Description

| IN
| `const Graph& g`
| The graph object on which the algorithm will be applied.
  The type `Graph` must be a model of
  xref:concepts/VertexAndEdgeListGraph.adoc[Vertex And Edge List Graph].

| IN/OUT
| `PositionMap position_map`
| The property map that stores the position of each vertex. The type
  `PositionMap` must be a model of
  link:../../property_map/doc/LvaluePropertyMap.html[Lvalue Property Map]
  such that the vertex descriptor type of `Graph` is convertible to its
  key type. Its value type must be `Topology::point_type`, representing
  the coordinates of the vertex.

| IN
| `const Topology& space`
| The topology used to lay out the vertices. This parameter describes both
  the size and shape of the layout area and provides a random number
  generator used to create random positions within the space. Topologies
  are described in more detail (with a list of BGL-provided topologies)
  xref:algorithms/layout/topology.adoc[in separate documentation].

|===

