Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

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 
43 namespace ogdf {
44 class GraphAttributes;
45 class GraphCopySimple;
46 
48 
99  std::unique_ptr<AcyclicSubgraphModule> m_subgraph;
100  bool m_sepDeg0;
105 
106  int m_offset, m_maxN;
107 
111 
112 public:
115 
116 
122  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 
155 
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 
204  void setSubgraph(AcyclicSubgraphModule* pSubgraph) { m_subgraph.reset(pSubgraph); }
206 
208 
209 private:
211  void doCall(const Graph& G, NodeArray<int>& rank, EdgeArray<bool>& reversed,
212  const EdgeArray<int>& length);
213 
214  void join(GraphCopySimple& GC, NodeArray<node>& superNode,
215  NodeArray<SListPure<node>>& joinedNodes, node v, node w);
216 
217  void dfs(node v);
218  void getTmpRank(node v, NodeArray<int>& rank);
219  void dfsAdd(node v, NodeArray<int>& rank);
220 };
221 
222 }
ogdf
The namespace for all OGDF objects.
Definition: multilevelmixer.cpp:39
ogdf::GraphAttributes
Stores additional attributes of a graph (like layout information).
Definition: GraphAttributes.h:72
Graph.h
Includes declaration of graph class.
RankingModule.h
Declaration of interface for ranking algorithms.
ogdf::LongestPathRanking::m_ingoing
NodeArray< int > m_ingoing
Definition: LongestPathRanking.h:110
ogdf::LongestPathRanking::m_offset
int m_offset
Definition: LongestPathRanking.h:106
ogdf::LongestPathRanking::alignSiblings
void alignSiblings(bool b)
Sets the option for alignment of siblings to b.
Definition: LongestPathRanking.h:197
ogdf::LongestPathRanking::alignSiblings
bool alignSiblings() const
Returns the current setting of option for alignment of siblings.
Definition: LongestPathRanking.h:194
ogdf::LongestPathRanking::m_sepDeg0
bool m_sepDeg0
Put isolated nodes on a separate layer?
Definition: LongestPathRanking.h:100
ogdf::RankingModule
Interface of algorithms for computing a node ranking.
Definition: RankingModule.h:46
ogdf::LongestPathRanking::m_isSource
NodeArray< bool > m_isSource
Definition: LongestPathRanking.h:108
ogdf::LongestPathRanking::optimizeEdgeLength
bool optimizeEdgeLength() const
Returns the current setting of option optimizeEdgeLength.
Definition: LongestPathRanking.h:182
ogdf::LongestPathRanking::m_subgraph
std::unique_ptr< AcyclicSubgraphModule > m_subgraph
The acyclic sugraph module.
Definition: LongestPathRanking.h:99
ogdf::NodeArray
internal::GraphRegisteredArray< NodeElement, Value, WithDefault > NodeArray
RegisteredArray for labeling the nodes in a Graph with an arbitrary Value.
Definition: Graph_d.h:740
ogdf::LongestPathRanking::m_alignSiblings
bool m_alignSiblings
Align siblings (callUML only).
Definition: LongestPathRanking.h:104
AcyclicSubgraphModule.h
Declaration of interface for acyclic subgraph algorithms.
ogdf::sync_plan::join
void join(Graph &G, node u, node v, sync_plan::PipeBij &bij, List< bool > *reverse_v=nullptr)
ogdf::LongestPathRanking::separateMultiEdges
void separateMultiEdges(bool b)
Sets the option separateMultiEdges to b.
Definition: LongestPathRanking.h:173
ogdf::LongestPathRanking::m_adjacent
NodeArray< SListPure< Tuple2< node, int > > > m_adjacent
Definition: LongestPathRanking.h:109
SList.h
Declaration of singly linked lists and iterators.
ogdf::LongestPathRanking::alignBaseClasses
void alignBaseClasses(bool b)
Sets the option for alignment of base classes to b.
Definition: LongestPathRanking.h:191
ogdf::node
NodeElement * node
The type of nodes.
Definition: Graph_d.h:70
ogdf::LongestPathRanking::m_separateMultiEdges
bool m_separateMultiEdges
Separate multi-edges?
Definition: LongestPathRanking.h:101
ogdf::internal::GraphRegisteredArray
RegisteredArray for nodes, edges and adjEntries of a graph.
Definition: Graph_d.h:658
ogdf::Graph
Data type for general directed graphs (adjacency list representation).
Definition: Graph_d.h:869
ogdf::LongestPathRanking::m_optimizeEdgeLength
bool m_optimizeEdgeLength
Optimize for short edges.
Definition: LongestPathRanking.h:102
ogdf::LongestPathRanking::separateDeg0Layer
void separateDeg0Layer(bool sdl)
Sets the option separateDeg0Layer to sdl.
Definition: LongestPathRanking.h:162
ogdf::LongestPathRanking::call
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.
Definition: LongestPathRanking.h:142
ogdf::LongestPathRanking::m_alignBaseClasses
bool m_alignBaseClasses
Align base classes (callUML only).
Definition: LongestPathRanking.h:103
ogdf::LongestPathRanking::alignBaseClasses
bool alignBaseClasses() const
Returns the current setting of alignment of base classes (callUML only).
Definition: LongestPathRanking.h:188
ogdf::LongestPathRanking
The longest-path ranking algorithm.
Definition: LongestPathRanking.h:98
basic.h
Basic declarations, included by all source files.
ogdf::LongestPathRanking::optimizeEdgeLength
void optimizeEdgeLength(bool b)
Sets the option optimizeEdgeLength to b.
Definition: LongestPathRanking.h:185
OGDF_EXPORT
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF DLL.
Definition: config.h:101
ogdf::AcyclicSubgraphModule
Base class of algorithms for computing a maximal acyclic subgraph.
Definition: AcyclicSubgraphModule.h:47
ogdf::LongestPathRanking::separateDeg0Layer
bool separateDeg0Layer() const
Returns the current setting of option separateDeg0Layer.
Definition: LongestPathRanking.h:159
ogdf::LongestPathRanking::separateMultiEdges
bool separateMultiEdges() const
Returns the current setting of option separateMultiEdges.
Definition: LongestPathRanking.h:170
tuples.h
Declaration and implementation of class Tuple2, Tuple3 and Tuple4.
ogdf::internal::EdgeArrayBase2
RegisteredArray for edges of a graph, specialized for EdgeArray<edge>.
Definition: Graph_d.h:716