Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

LongestPathRanking.h
Go to the documentation of this file.
1 
32 #pragma once
33 
35 #include <ogdf/basic/GraphCopy.h>
36 #include <ogdf/basic/NodeArray.h>
37 #include <ogdf/basic/SList.h>
38 #include <ogdf/basic/tuples.h>
41 
42 #include <memory>
43 
44 namespace ogdf {
45 
47 
98  std::unique_ptr<AcyclicSubgraphModule> m_subgraph;
99  bool m_sepDeg0;
104 
105  int m_offset, m_maxN;
106 
110 
111 public:
114 
115 
121  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 
147  void callUML(const GraphAttributes& AG, NodeArray<int>& rank);
148 
154 
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 
203  void setSubgraph(AcyclicSubgraphModule* pSubgraph) { m_subgraph.reset(pSubgraph); }
205 
207 
208 private:
210  void doCall(const Graph& G, NodeArray<int>& rank, EdgeArray<bool>& reversed,
211  const EdgeArray<int>& length);
212 
213  void join(GraphCopySimple& GC, NodeArray<node>& superNode,
214  NodeArray<SListPure<node>>& joinedNodes, node v, node w);
215 
216  void dfs(node v);
217  void getTmpRank(node v, NodeArray<int>& rank);
218  void dfsAdd(node v, NodeArray<int>& rank);
219 };
220 
221 }
ogdf
The namespace for all OGDF objects.
Definition: AugmentationModule.h:36
ogdf::GraphAttributes
Stores additional attributes of a graph (like layout information).
Definition: GraphAttributes.h:66
GraphAttributes.h
Declaration of class GraphAttributes which extends a Graph by additional attributes.
RankingModule.h
Declaration of interface for ranking algorithms.
ogdf::LongestPathRanking::m_ingoing
NodeArray< int > m_ingoing
Definition: LongestPathRanking.h:109
ogdf::LongestPathRanking::m_offset
int m_offset
Definition: LongestPathRanking.h:105
ogdf::LongestPathRanking::alignSiblings
void alignSiblings(bool b)
Sets the option for alignment of siblings to b.
Definition: LongestPathRanking.h:196
ogdf::LongestPathRanking::alignSiblings
bool alignSiblings() const
Returns the current setting of option for alignment of siblings.
Definition: LongestPathRanking.h:193
ogdf::LongestPathRanking::m_sepDeg0
bool m_sepDeg0
Put isolated nodes on a separate layer?
Definition: LongestPathRanking.h:99
ogdf::RankingModule
Interface of algorithms for computing a node ranking.
Definition: RankingModule.h:44
ogdf::LongestPathRanking::m_isSource
NodeArray< bool > m_isSource
Definition: LongestPathRanking.h:107
ogdf::LongestPathRanking::optimizeEdgeLength
bool optimizeEdgeLength() const
Returns the current setting of option optimizeEdgeLength.
Definition: LongestPathRanking.h:181
ogdf::LongestPathRanking::m_subgraph
std::unique_ptr< AcyclicSubgraphModule > m_subgraph
The acyclic sugraph module.
Definition: LongestPathRanking.h:98
ogdf::NodeArray
internal::GraphRegisteredArray< NodeElement, Value, WithDefault > NodeArray
RegisteredArray for labeling the nodes in a Graph with an arbitrary Value.
Definition: Graph_d.h:733
ogdf::LongestPathRanking::m_alignSiblings
bool m_alignSiblings
Align siblings (callUML only).
Definition: LongestPathRanking.h:103
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:172
ogdf::LongestPathRanking::m_adjacent
NodeArray< SListPure< Tuple2< node, int > > > m_adjacent
Definition: LongestPathRanking.h:108
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:190
ogdf::node
NodeElement * node
The type of nodes.
Definition: Graph_d.h:63
GraphCopy.h
Declaration of graph copy classes.
ogdf::LongestPathRanking::m_separateMultiEdges
bool m_separateMultiEdges
Separate multi-edges?
Definition: LongestPathRanking.h:100
ogdf::internal::GraphRegisteredArray
RegisteredArray for nodes, edges and adjEntries of a graph.
Definition: Graph_d.h:651
ogdf::Graph
Data type for general directed graphs (adjacency list representation).
Definition: Graph_d.h:862
ogdf::LongestPathRanking::m_optimizeEdgeLength
bool m_optimizeEdgeLength
Optimize for short edges.
Definition: LongestPathRanking.h:101
ogdf::LongestPathRanking::separateDeg0Layer
void separateDeg0Layer(bool sdl)
Sets the option separateDeg0Layer to sdl.
Definition: LongestPathRanking.h:161
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:141
NodeArray.h
Declaration and implementation of NodeArray class.
ogdf::LongestPathRanking::m_alignBaseClasses
bool m_alignBaseClasses
Align base classes (callUML only).
Definition: LongestPathRanking.h:102
ogdf::LongestPathRanking::alignBaseClasses
bool alignBaseClasses() const
Returns the current setting of alignment of base classes (callUML only).
Definition: LongestPathRanking.h:187
ogdf::LongestPathRanking
The longest-path ranking algorithm.
Definition: LongestPathRanking.h:97
ogdf::LongestPathRanking::optimizeEdgeLength
void optimizeEdgeLength(bool b)
Sets the option optimizeEdgeLength to b.
Definition: LongestPathRanking.h:184
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:43
ogdf::LongestPathRanking::separateDeg0Layer
bool separateDeg0Layer() const
Returns the current setting of option separateDeg0Layer.
Definition: LongestPathRanking.h:158
ogdf::LongestPathRanking::separateMultiEdges
bool separateMultiEdges() const
Returns the current setting of option separateMultiEdges.
Definition: LongestPathRanking.h:169
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:709