...one of the most highly
regarded and expertly designed C++ library projects in the
world.

— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards

// non-named parameter versiontemplate<typename Graph, typename PositionMap, typename Dimension, typename RandomNumberGenerator> void random_graph_layout(const Graph& g, PositionMap position_map, Dimension minX, Dimension maxX, Dimension minY, Dimension maxY, RandomNumberGenerator& gen);

This algorithm places the points of the graph at random locations.

The graph object on which the algorithm will be applied. The typeIN/OUT:Graphmust be a model of Vertex And Edge List Graph.

The property map that stores the position of each vertex. The typeIN:PositionMapmust be a model of Lvalue Property Map such that the vertex descriptor type ofGraphis convertible to its key type. Its value type must be a structure with fieldsxandy, representing the coordinates of the vertex.

The minimumIN:xcoordinate.

The maximumIN:xcoordinate.

The minimumIN:ycoordinate.

The maximumIN/UTIL:ycoordinate.

A random number generator that will be used to place vertices. The typeRandomNumberGeneratormust model the NumberGenerator concept.

The time complexity is *O(|V|)*.

Copyright © 2004 | Doug Gregor, Indiana University |