Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

Loading...
Searching...
No Matches
Hierarchy.h
Go to the documentation of this file.
1
32#pragma once
33
34#include <ogdf/basic/Array.h>
35#include <ogdf/basic/Graph.h>
37#include <ogdf/basic/basic.h>
38
39namespace ogdf {
40template<class E>
41class List;
42
44
48 friend class LayerBasedUPRLayout;
49
53
54public:
57
59 Hierarchy(const Graph& G, const NodeArray<int>& rank);
60
61 // destruction
63
64 void createEmpty(const Graph& G);
65 void initByNodes(const List<node>& nodes, EdgeArray<edge>& eCopy, const NodeArray<int>& rank);
66
68 operator const GraphCopy&() const { return m_GC; }
69
71 int rank(node v) const { return m_rank[v]; }
72
73 int maxRank() const { return m_size.high(); }
74
75 int size(int i) const { return m_size[i]; }
76
77 bool isLongEdgeDummy(node v) const { return m_GC.isDummy(v) && v->outdeg() == 1; }
78
79private:
80 void doInit(const NodeArray<int>& rank);
81};
82
83}
Declaration and implementation of Array class and Array algorithms.
Includes declaration of graph class.
Declaration of graph copy classes.
Basic declarations, included by all source files.
The parameterized class Array implements dynamic arrays of type E.
Definition Array.h:219
INDEX high() const
Returns the maximal array index.
Definition Array.h:299
bool isDummy(node v) const
Returns true iff v has no corresponding node in the original graph.
Definition GraphCopy.h:172
Copies of graphs supporting edge splitting.
Definition GraphCopy.h:390
Data type for general directed graphs (adjacency list representation).
Definition Graph_d.h:866
Representation of proper hierarchies used by Sugiyama-layout.
Definition Hierarchy.h:47
NodeArray< int > m_rank
The rank (level) of a node.
Definition Hierarchy.h:51
void initByNodes(const List< node > &nodes, EdgeArray< edge > &eCopy, const NodeArray< int > &rank)
Hierarchy(const Graph &G, const NodeArray< int > &rank)
Creates an hierarchy of graph G with node ranks rank.
int maxRank() const
Definition Hierarchy.h:73
bool isLongEdgeDummy(node v) const
Definition Hierarchy.h:77
int rank(node v) const
Returns the rank (level) of node v.
Definition Hierarchy.h:71
int size(int i) const
Definition Hierarchy.h:75
Hierarchy()
Creates an empty hierarchy.
Definition Hierarchy.h:56
Array< int > m_size
Definition Hierarchy.h:52
void doInit(const NodeArray< int > &rank)
void createEmpty(const Graph &G)
GraphCopy m_GC
The graph copy representing the topology of the proper hierarchy.
Definition Hierarchy.h:50
Doubly linked lists (maintaining the length of the list).
Definition List.h:1451
Class for the representation of nodes.
Definition Graph_d.h:241
int outdeg() const
Returns the outdegree of the node.
Definition Graph_d.h:281
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:117
The namespace for all OGDF objects.