Open
Graph Drawing
Framework

 v. 2022.02 (Dogwood)
 

ogdf::LayoutStatistics Class Reference

Computes statistical information about a layout. More...

#include <ogdf/basic/LayoutStatistics.h>

Static Public Member Functions

static ArrayBuffer< double > angles (const GraphAttributes &ga, bool considerBends=true)
 Computes the angle for each pair of adjacent edge segments of the layout ga. More...
 
static ArrayBuffer< double > edgeLengths (const GraphAttributes &ga, bool considerSelfLoops=false)
 Computes the edge length for each edge in the layout ga. More...
 
static void intersectionGraph (const GraphAttributes &ga, Graph &H, NodeArray< DPoint > &points, NodeArray< node > &origNode, EdgeArray< edge > &origEdge)
 Computes the intersection graph H of the line segments in the layout given by ga. More...
 
static ArrayBuffer< int > numberOfBends (const GraphAttributes &ga, bool considerSelfLoops=false)
 Computes the number of bends (i.e. bend-points) for each edge in the layout ga. More...
 
static ArrayBuffer< int > numberOfCrossings (const GraphAttributes &ga)
 Computes the number of edge crossings for each edge in the layout ga. More...
 
static ArrayBuffer< int > numberOfNodeCrossings (const GraphAttributes &ga)
 Computes the number of crossings through a non-incident node for each edge in the layout ga. More...
 
static ArrayBuffer< int > numberOfNodeOverlaps (const GraphAttributes &ga)
 Computes the number of node overlaps for each node in the layout ga. More...
 

Detailed Description

Computes statistical information about a layout.

Definition at line 45 of file LayoutStatistics.h.

Member Function Documentation

◆ angles()

static ArrayBuffer<double> ogdf::LayoutStatistics::angles ( const GraphAttributes ga,
bool  considerBends = true 
)
static

Computes the angle for each pair of adjacent edge segments of the layout ga.

Angles are given in radians.

Parameters
gaInput layout.
considerBendsDetermines whether bend points of edges shall be considered.
Returns
The angle for each two adjacent edge segments.

◆ edgeLengths()

static ArrayBuffer<double> ogdf::LayoutStatistics::edgeLengths ( const GraphAttributes ga,
bool  considerSelfLoops = false 
)
static

Computes the edge length for each edge in the layout ga.

Parameters
gaInput layout.
considerSelfLoopsDetermines whether the lengths of self-loops are considered.
Returns
The edge length for each edge.

◆ intersectionGraph()

static void ogdf::LayoutStatistics::intersectionGraph ( const GraphAttributes ga,
Graph H,
NodeArray< DPoint > &  points,
NodeArray< node > &  origNode,
EdgeArray< edge > &  origEdge 
)
static

Computes the intersection graph H of the line segments in the layout given by ga.

The nodes of the intersection graph are all endpoints of segments in ga plus all intersection points. The edges corrsepond to edges in the input layout: If an edge connecting points v and w in H corresponds to an edge e in the input graph, then e contains a line segment s such that both v and w are endpoints or intersection points of s.

To put it more simple, we obtain graph H from ga by putting a dummy vertex on each crossing and bend point, and joining all nodes representing the same point in the plane.

Warning
Do not call this algorithm on drawings with arbitrarily close curves (e.g., curves overlapping on an interval).
Parameters
gaInput layout. If it contains bend points, each segment of an edge's polyline is considered as a line segment. Otherwise, a straight-line drawing is assumed.
HIs assigned the intersection graph.
pointsMaps nodes in H to their geometric position in the layout.
origNodeMaps nodes in H to nodes in ga's graph. Points that are only intersection points of segments are mapped to nullptr.
origEdgeMaps edges in H to the corresponding edges in ga's graph.

◆ numberOfBends()

static ArrayBuffer<int> ogdf::LayoutStatistics::numberOfBends ( const GraphAttributes ga,
bool  considerSelfLoops = false 
)
static

Computes the number of bends (i.e. bend-points) for each edge in the layout ga.

Parameters
gaInput layout.
considerSelfLoopsDetermines whether the bends of self-loops are considered.
Returns
The number of bends for each edge.

◆ numberOfCrossings()

static ArrayBuffer<int> ogdf::LayoutStatistics::numberOfCrossings ( const GraphAttributes ga)
static

Computes the number of edge crossings for each edge in the layout ga.

If several edge segments cross in the same point, this is counted as if all of these segments would cross pairwise. E.g., if three edge segments cross in a common points, this counts as two crossings for each of the edges.

Warning
The same warning as for intersectionGraph applies.
The sum of all returned values is twice the number of crossings as each crossing involves two edges.
Parameters
gaInput layout. If it contains bend points, each segment of an edge's polyline is considered as a line segment. Otherwise, a straight-line drawing is assumed.
Returns
The number of crossings for each edge.

◆ numberOfNodeCrossings()

static ArrayBuffer<int> ogdf::LayoutStatistics::numberOfNodeCrossings ( const GraphAttributes ga)
static

Computes the number of crossings through a non-incident node for each edge in the layout ga.

If several edge segments cross a node in the same point, one crossing per edge segment is counted. E.g., if three edge segments cross a node in a common point, this counts as three node crossings. Each node is treated as if it had the shape of the rectangle with the corresponding width and height given by ga.

Parameters
gaInput layout. If it contains bend points, each segment of an edge's polyline is considered as a line segment. Otherwise, a straight-line drawing is assumed.
Returns
The number of node crossings for each edge.

◆ numberOfNodeOverlaps()

static ArrayBuffer<int> ogdf::LayoutStatistics::numberOfNodeOverlaps ( const GraphAttributes ga)
static

Computes the number of node overlaps for each node in the layout ga.

Each node is treated as if it had the shape of the rectangle with the corresponding width and height given by ga.

Warning
The sum of all returned values is twice the number of node overlaps as each node overlap involves two nodes.
Parameters
gaInput layout.
Returns
The number of node overlaps for each node.

The documentation for this class was generated from the following file: