Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

Loading...
Searching...
No Matches
LongestPathRanking.h
Go to the documentation of this file.
1
32#pragma once
33
37#include <ogdf/basic/SList.h>
38#include <ogdf/basic/tuples.h>
41
42#include <memory>
43
44namespace ogdf {
45
47
98 std::unique_ptr<AcyclicSubgraphModule> m_subgraph;
99 bool m_sepDeg0;
104
105 int m_offset, m_maxN;
106
110
111public:
114
115
122 virtual void call(const Graph& G, NodeArray<int>& rank) override;
123
125
130 void call(const Graph& G, const EdgeArray<int>& length, NodeArray<int>& rank);
131
133
141 virtual void call(const Graph& G, const EdgeArray<int>& length, const EdgeArray<int>& cost,
142 NodeArray<int>& rank) override {
143 call(G, length, rank);
144 }
145
148
155
158 bool separateDeg0Layer() const { return m_sepDeg0; }
159
161 void separateDeg0Layer(bool sdl) { m_sepDeg0 = sdl; }
162
164
169 bool separateMultiEdges() const { return m_separateMultiEdges; }
170
172 void separateMultiEdges(bool b) { m_separateMultiEdges = b; }
173
175
181 bool optimizeEdgeLength() const { return m_optimizeEdgeLength; }
182
184 void optimizeEdgeLength(bool b) { m_optimizeEdgeLength = b; }
185
187 bool alignBaseClasses() const { return m_alignBaseClasses; }
188
190 void alignBaseClasses(bool b) { m_alignBaseClasses = b; }
191
193 bool alignSiblings() const { return m_alignSiblings; }
194
196 void alignSiblings(bool b) { m_alignSiblings = b; }
197
205
207
208private:
211 const EdgeArray<int>& length);
212
215
216 void dfs(node v);
218 void dfsAdd(node v, NodeArray<int>& rank);
219};
220
221}
Declaration of interface for acyclic subgraph algorithms.
Declaration of class GraphAttributes which extends a Graph by additional attributes.
Declaration of graph copy classes.
Declaration and implementation of NodeArray class.
Declaration of interface for ranking algorithms.
Declaration of singly linked lists and iterators.
Base class of algorithms for computing a maximal acyclic subgraph.
Dynamic arrays indexed with edges.
Definition EdgeArray.h:125
Stores additional attributes of a graph (like layout information).
Copies of graphs with mapping between nodes and edges.
Definition GraphCopy.h:59
Data type for general directed graphs (adjacency list representation).
Definition Graph_d.h:521
The longest-path ranking algorithm.
bool separateDeg0Layer() const
Returns the current setting of option separateDeg0Layer.
virtual void call(const Graph &G, const EdgeArray< int > &length, const EdgeArray< int > &cost, NodeArray< int > &rank) override
Computes a node ranking of G with given minimal edge length in rank.
void getTmpRank(node v, NodeArray< int > &rank)
void call(const Graph &G, const EdgeArray< int > &length, NodeArray< int > &rank)
Computes a node ranking of G with given minimal edge length in rank.
bool alignBaseClasses() const
Returns the current setting of alignment of base classes (callUML only).
bool alignSiblings() const
Returns the current setting of option for alignment of siblings.
bool optimizeEdgeLength() const
Returns the current setting of option optimizeEdgeLength.
LongestPathRanking()
Creates an instance of longest-path ranking.
void alignBaseClasses(bool b)
Sets the option for alignment of base classes to b.
void setSubgraph(AcyclicSubgraphModule *pSubgraph)
Sets the module for the computation of the acyclic subgraph.
bool m_alignSiblings
Align siblings (callUML only).
void alignSiblings(bool b)
Sets the option for alignment of siblings to b.
void dfsAdd(node v, NodeArray< int > &rank)
NodeArray< SListPure< Tuple2< node, int > > > m_adjacent
bool m_separateMultiEdges
Separate multi-edges?
virtual void call(const Graph &G, NodeArray< int > &rank) override
Computes a node ranking of G in rank.
void join(GraphCopySimple &GC, NodeArray< node > &superNode, NodeArray< SListPure< node > > &joinedNodes, node v, node w)
std::unique_ptr< AcyclicSubgraphModule > m_subgraph
The acyclic sugraph module.
void doCall(const Graph &G, NodeArray< int > &rank, EdgeArray< bool > &reversed, const EdgeArray< int > &length)
Implements the algorithm call.
bool m_optimizeEdgeLength
Optimize for short edges.
void separateDeg0Layer(bool sdl)
Sets the option separateDeg0Layer to sdl.
void optimizeEdgeLength(bool b)
Sets the option optimizeEdgeLength to b.
void separateMultiEdges(bool b)
Sets the option separateMultiEdges to b.
void callUML(const GraphAttributes &AG, NodeArray< int > &rank)
Call for UML graphs with special treatement of inheritance hierarchies.
bool separateMultiEdges() const
Returns the current setting of option separateMultiEdges.
bool m_alignBaseClasses
Align base classes (callUML only).
bool m_sepDeg0
Put isolated nodes on a separate layer?
Dynamic arrays indexed with nodes.
Definition NodeArray.h:125
Class for the representation of nodes.
Definition Graph_d.h:177
Interface of algorithms for computing a node ranking.
Singly linked lists.
Definition SList.h:179
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF DLL.
Definition config.h:101
static MultilevelBuilder * getDoubleFactoredZeroAdjustedMerger()
The namespace for all OGDF objects.
Declaration and implementation of class Tuple2, Tuple3 and Tuple4.