Open
Graph Drawing
Framework

 v. 2025.10-dev (Foxglove)
 

Loading...
Searching...
No Matches
LayoutStatistics.h
Go to the documentation of this file.
1
33#pragma once
34
36#include <ogdf/basic/Graph.h>
37#include <ogdf/basic/basic.h>
38#include <ogdf/basic/geometry.h>
39
40#include <cstddef>
41
42namespace ogdf {
43class GraphAttributes;
44
46
50public:
52
60 static double graphArea(const GraphAttributes& ga);
61
63
72 static double aspectRatio(const GraphAttributes& ga);
73
75
80 static EdgeArray<double> edgeLengths(const GraphAttributes& ga, bool considerSelfLoops = false);
81
83
88 static EdgeArray<size_t> numberOfBends(const GraphAttributes& ga, bool considerSelfLoops = false);
89
91
98 static ArrayBuffer<double> angles(const GraphAttributes& ga, bool considerBends = true);
99
101
116
119
131
134
150
152
163
165
184 static void intersectionGraph(const GraphAttributes& ga, Graph& H, NodeArray<DPoint>& points,
185 NodeArray<node>& origNode, EdgeArray<edge>& origEdge);
186
188
198
200
211
213
222 static NodeArray<double> gabrielRatio(const GraphAttributes& ga, Graph& gabrielGraphReference);
223
225
233 static double nodeResolution(const GraphAttributes& ga);
234
236
245 static double angularResolution(const GraphAttributes& ga);
246
248
262 static double nodeUniformity(const GraphAttributes& ga, size_t gridWidth = 10,
263 size_t gridHeight = 10);
264
266
275 static double edgeOrthogonality(const GraphAttributes& ga);
276
278
293
295
306 static double closestPairOfPoints(const GraphAttributes& ga);
307
309
321 static double horizontalVerticalBalance(const GraphAttributes& ga, const bool vertical = false);
322
324
336 static double nodeOrthogonality(const GraphAttributes& ga, const double epsilon = 1e-9);
337
339
350 static double averageFlow(const GraphAttributes& ga);
351
353
366 static double upwardsFlow(const GraphAttributes& ga);
367
369
380 static double concentration(const GraphAttributes& ga);
381};
382}
Declaration and implementation of ArrayBuffer class.
Includes declaration of graph class.
Declaration of classes GenericPoint, GenericPolyline, GenericLine, GenericSegment,...
Basic declarations, included by all source files.
An array that keeps track of the number of inserted elements; also usable as an efficient stack.
Definition ArrayBuffer.h:64
Stores additional attributes of a graph (like layout information).
Data type for general directed graphs (adjacency list representation).
Definition Graph_d.h:866
Computes statistical information about a layout.
static double edgeOrthogonality(const GraphAttributes &ga)
Computes Edge Orthogonality (EO) H of the graph g.
static NodeArray< double > gabrielRatio(const GraphAttributes &ga, Graph &gabrielGraphReference)
Computes Gabriel Ratio H of the edges in the graph given, in ga and also returns new set of edges tha...
static EdgeArray< size_t > numberOfNodeCrossings(const GraphAttributes &ga)
Computes the number of crossings through a non-incident node for each edge in the layout ga.
static double nodeUniformity(const GraphAttributes &ga, size_t gridWidth=10, size_t gridHeight=10)
Computes Node Uniformity (NU) H of the graph g.
static double closestPairOfPoints(const GraphAttributes &ga)
Computes Closest pair of points.
static double aspectRatio(const GraphAttributes &ga)
Computes Aspect Ratio (Asp) H of the layout/graph g.
static NodeArray< double > neighbourhoodPreservation(const GraphAttributes &ga)
Computes neighborhood preservation H of the edges in the graph given, in ga.
static double nodeResolution(const GraphAttributes &ga)
Computes Node Ratio H of the nodes in the graph given, in ga.
static double upwardsFlow(const GraphAttributes &ga)
Calculates percentage of edges that point upwards.
static double nodeOrthogonality(const GraphAttributes &ga, const double epsilon=1e-9)
Calculating percentage of nodes with integer coordinates.
static NodeArray< size_t > numberOfNodeOverlaps(const GraphAttributes &ga)
Computes the number of node overlaps for each node in the layout ga.
static DPoint centerOfMass(const GraphAttributes &ga)
Computes center of mass, where most nodes are.
static double concentration(const GraphAttributes &ga)
Calculates the variance of node distances from the center of mass.
static double percentageCrossingVsMaxCrossings(const GraphAttributes &ga)
Computes the percentage of crossings for each edge in the layout ga compared to the maximum number of...
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.
static double graphArea(const GraphAttributes &ga)
Computes graph area (respecting node sizes), in coordinate length metric.
static double edgeLengthDeviation(const GraphAttributes &ga, EdgeArray< double > &out)
Computes the edge length deviation H of the edges in the graph given, in ga.
static double averageFlow(const GraphAttributes &ga)
Calculates mean edge direction (vector) angle.
static EdgeArray< size_t > numberOfCrossings(const GraphAttributes &ga)
Computes the number of edge crossings for each edge in the layout ga.
static double angularResolution(const GraphAttributes &ga)
Computes Angular Resolution (AR) H of the nodes in the graph given, in ga.
static EdgeArray< double > edgeLengths(const GraphAttributes &ga, bool considerSelfLoops=false)
Computes the edge length for each edge in the layout ga.
static EdgeArray< size_t > numberOfBends(const GraphAttributes &ga, bool considerSelfLoops=false)
Computes the number of bends (i.e. bend-points) for each edge in the layout ga.
static ArrayBuffer< double > angles(const GraphAttributes &ga, bool considerBends=true)
Computes the angle for each pair of adjacent edge segments of the layout ga.
static double horizontalVerticalBalance(const GraphAttributes &ga, const bool vertical=false)
Computes horizontal node balance.
RegisteredArray for edges of a graph, specialized for EdgeArray<edge>.
Definition Graph_d.h:717
RegisteredArray for nodes, edges and adjEntries of a graph.
Definition Graph_d.h:659
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF dynamic library (shared object / DLL),...
Definition config.h:118
The namespace for all OGDF objects.