gursoy_atun_layout
Performs layout of directed graphs by distributing vertices uniformly within a topology using a self-organizing map approach.
Defined in: <boost/graph/gursoy_atun_layout.hpp>
Example
#include <boost/graph/adjacency_list.hpp>
#include <boost/graph/gursoy_atun_layout.hpp>
#include <boost/graph/topology.hpp>
#include <iostream>
#include <vector>
using Graph = boost::adjacency_list<boost::vecS, boost::vecS, boost::undirectedS>;
using Point = boost::heart_topology<>::point_type;
int main() {
Graph g(5);
boost::add_edge(0, 1, g);
boost::add_edge(1, 2, g);
boost::add_edge(2, 3, g);
boost::add_edge(3, 4, g);
boost::add_edge(4, 0, g);
std::vector<Point> positions(num_vertices(g));
auto pos_map = boost::make_iterator_property_map(
positions.begin(), get(boost::vertex_index, g));
boost::heart_topology<> topo;
boost::gursoy_atun_layout(g, topo, pos_map);
for (auto v : boost::make_iterator_range(vertices(g))) {
auto& p = positions[v];
std::cout << "vertex " << v << ": (" << p[0] << ", " << p[1] << ")\n";
}
}
vertex 0: (514.87, -419.216)
vertex 1: (182.934, -886.593)
vertex 2: (-276.483, -765.037)
vertex 3: (-303.602, -523.701)
vertex 4: (338.437, -210.444)
(1) Positional version
template<typename VertexListAndIncidenceGraph, typename Topology,
typename PositionMap, typename VertexIndexMap,
typename EdgeWeightMap>
void gursoy_atun_layout(
const VertexListAndIncidenceGraph& g,
const Topology& space,
PositionMap position,
int nsteps = num_vertices(g),
double diameter_initial = sqrt((double)num_vertices(g)),
double diameter_final = 1,
double learning_constant_initial = 0.8,
double learning_constant_final = 0.2,
VertexIndexMap vertex_index_map = get(vertex_index, g),
EdgeWeightMap weight = dummy_property_map());
| Direction | Parameter | Description |
|---|---|---|
IN |
|
The graph object on which the algorithm will be applied. The type must be a model of Vertex List Graph and Incidence Graph. |
IN |
|
The topology on which the graph will be laid out. The type must model the Topology concept. |
OUT |
|
The property map that stores the position of each vertex. The type
|
IN |
|
The number of iterations to perform. |
IN |
|
When a vertex is selected to be updated, all vertices that are reachable
from that vertex within a certain diameter (in graph terms) will also be
updated. This diameter begins at |
IN |
|
The final value of the diameter. |
IN |
|
The learning rate affects how far vertices can be moved to rearrange
themselves in a given iteration. The learning rate progresses linearly
from the initial value to the final value, both of which should be between
0 and 1. The learning rate should typically decrease, so the initial value
should not exceed the final value. |
IN |
|
The final learning rate constant. |
IN |
|
This maps each vertex to an integer in the range
|
IN |
|
This maps each edge to a weight. The type |
(2) Named parameter version
template<typename VertexListAndIncidenceGraph, typename Topology,
typename PositionMap, typename P, typename T, typename R>
void gursoy_atun_layout(
const VertexListAndIncidenceGraph& g,
const Topology& space,
PositionMap position,
const bgl_named_params<P, T, R>& params = all defaults);
| Direction | Parameter | Description |
|---|---|---|
IN |
|
The graph object. Same requirements as (1). |
IN |
|
The topology on which the graph will be laid out. Same requirements as (1). |
OUT |
|
The position map for each vertex. Same requirements as (1). |
IN |
|
Named parameters passed via |
| Direction | Parameter | Description |
|---|---|---|
IN |
|
Executes the algorithm for n iterations. |
IN |
|
Range specifying the parameters ( |
IN |
|
Range specifying the parameters ( |
IN |
|
Equivalent to the non-named |
IN |
|
Equivalent to the non-named |
Description
This algorithm [54] performs layout of directed graphs, either weighted or unweighted. This algorithm is very different from the Kamada-Kawai and Fruchterman-Reingold algorithms, because it does not explicitly strive to layout graphs in a visually pleasing manner. Instead, it attempts to distribute the vertices uniformly within a topology (e.g., rectangle, sphere, heart shape), keeping vertices close to their neighbors; various topologies are provided by BGL, and users can also create their own. The algorithm itself is based on Self-Organizing Maps.


