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
34#include <ogdf/basic/Graph.h>
35#include <ogdf/basic/SList.h> // IWYU pragma: keep
36#include <ogdf/basic/basic.h>
37#include <ogdf/basic/tuples.h> // IWYU pragma: keep
40
41#include <memory>
42
43namespace ogdf {
44class GraphAttributes;
45class GraphCopySimple;
46
48
99 std::unique_ptr<AcyclicSubgraphModule> m_subgraph;
105
106 int m_offset, m_maxN;
107
111
112public:
115
116
123 virtual void call(const Graph& G, NodeArray<int>& rank) override;
124
126
131 void call(const Graph& G, const EdgeArray<int>& length, NodeArray<int>& rank);
132
134
142 virtual void call(const Graph& G, const EdgeArray<int>& length, const EdgeArray<int>& cost,
143 NodeArray<int>& rank) override {
144 call(G, length, rank);
145 }
146
148 void callUML(const GraphAttributes& AG, NodeArray<int>& rank);
149
156
159 bool separateDeg0Layer() const { return m_sepDeg0; }
160
162 void separateDeg0Layer(bool sdl) { m_sepDeg0 = sdl; }
163
165
170 bool separateMultiEdges() const { return m_separateMultiEdges; }
171
173 void separateMultiEdges(bool b) { m_separateMultiEdges = b; }
174
176
182 bool optimizeEdgeLength() const { return m_optimizeEdgeLength; }
183
185 void optimizeEdgeLength(bool b) { m_optimizeEdgeLength = b; }
186
188 bool alignBaseClasses() const { return m_alignBaseClasses; }
189
191 void alignBaseClasses(bool b) { m_alignBaseClasses = b; }
192
194 bool alignSiblings() const { return m_alignSiblings; }
195
197 void alignSiblings(bool b) { m_alignSiblings = b; }
198
205 void setSubgraph(AcyclicSubgraphModule* pSubgraph) { m_subgraph.reset(pSubgraph); }
206
208
209private:
211 void doCall(const Graph& G, NodeArray<int>& rank, EdgeArray<bool>& reversed,
212 const EdgeArray<int>& length);
213
215 NodeArray<SListPure<node>>& joinedNodes, node v, node w);
216
217 void dfs(node v);
219 void dfsAdd(node v, NodeArray<int>& rank);
220};
221
222}
Declaration of interface for acyclic subgraph algorithms.
Includes declaration of graph class.
Declaration of interface for ranking algorithms.
Declaration of singly linked lists and iterators.
Basic declarations, included by all source files.
Base class of algorithms for computing a maximal acyclic subgraph.
Stores additional attributes of a graph (like layout information).
Copies of graphs with mapping between nodes and edges.
Definition GraphCopy.h:260
Data type for general directed graphs (adjacency list representation).
Definition Graph_d.h:866
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?
Class for the representation of nodes.
Definition Graph_d.h:241
Interface of algorithms for computing a node ranking.
Singly linked lists.
Definition SList.h:191
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.
Declaration and implementation of class Tuple2, Tuple3 and Tuple4.