Open
Graph Drawing
Framework

 v. 2020.02 (Catalpa)
 

LongestPathRanking.h
Go to the documentation of this file.
1 
32 #pragma once
33 
36 #include <memory>
37 #include <ogdf/basic/SList.h>
38 #include <ogdf/basic/tuples.h>
39 #include <ogdf/basic/NodeArray.h>
40 #include <ogdf/basic/GraphCopy.h>
42 
43 namespace ogdf {
44 
46 
97 
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(
142  const Graph &G,
143  const EdgeArray<int> & length,
144  const EdgeArray<int> & cost,
145  NodeArray<int> &rank) override
146  {
147  call(G, length, rank);
148  }
149 
151  void callUML(const GraphAttributes &AG, NodeArray<int> &rank);
152 
153 
159 
163  bool separateDeg0Layer() const { return m_sepDeg0; }
164 
166  void separateDeg0Layer (bool sdl) { m_sepDeg0 = sdl; }
167 
169 
174  bool separateMultiEdges() const { return m_separateMultiEdges; }
175 
177  void separateMultiEdges(bool b) { m_separateMultiEdges = b; }
178 
180 
186  bool optimizeEdgeLength() const { return m_optimizeEdgeLength; }
187 
189  void optimizeEdgeLength(bool b) { m_optimizeEdgeLength = b; }
190 
192  bool alignBaseClasses() const { return m_alignBaseClasses; }
193 
195  void alignBaseClasses(bool b) { m_alignBaseClasses = b; }
196 
198  bool alignSiblings() const { return m_alignSiblings; }
199 
201  void alignSiblings(bool b) { m_alignSiblings = b; }
202 
203 
209  void setSubgraph(AcyclicSubgraphModule *pSubgraph) {
211  m_subgraph.reset(pSubgraph);
212  }
213 
215 
216 private:
218  void doCall(const Graph& G,
219  NodeArray<int> &rank,
220  EdgeArray<bool> &reversed,
221  const EdgeArray<int> &length);
222 
223  void join(
224  GraphCopySimple &GC,
225  NodeArray<node> &superNode,
226  NodeArray<SListPure<node> > &joinedNodes,
227  node v, node w);
228 
229  void dfs(node v);
230  void getTmpRank(node v, NodeArray<int> &rank);
231  void dfsAdd(node v, NodeArray<int> &rank);
232 };
233 
234 }
Declaration of singly linked lists and iterators.
The longest-path ranking algorithm.
Declaration of class GraphAttributes which extends a Graph by additional attributes.
void separateDeg0Layer(bool sdl)
Sets the option separateDeg0Layer to sdl.
bool m_optimizeEdgeLength
Optimize for short edges.
Data type for general directed graphs (adjacency list representation).
Definition: Graph_d.h:492
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF DLL.
Definition: config.h:99
bool m_sepDeg0
Put isolated nodes on a separate layer?
Singly linked lists.
Definition: SList.h:38
void optimizeEdgeLength(bool b)
Sets the option optimizeEdgeLength to b.
void alignBaseClasses(bool b)
Sets the option for alignment of base classes to b.
bool m_alignBaseClasses
Align base classes (callUML only).
NodeArray< bool > m_isSource
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.
bool m_alignSiblings
Align siblings (callUML only).
bool alignSiblings() const
Returns the current setting of option for alignment of siblings.
Stores additional attributes of a graph (like layout information).
Declaration of graph copy classes.
std::unique_ptr< AcyclicSubgraphModule > m_subgraph
The acyclic sugraph module.
Copies of graphs with mapping between nodes and edges.
Definition: GraphCopy.h:60
Declaration of interface for ranking algorithms.
Class for the representation of nodes.
Definition: Graph_d.h:169
Declaration and implementation of NodeArray class.
Base class of algorithms for computing a maximal acyclic subgraph.
void alignSiblings(bool b)
Sets the option for alignment of siblings to b.
bool optimizeEdgeLength() const
Returns the current setting of option optimizeEdgeLength.
Declaration and implementation of class Tuple2, Tuple3 and Tuple4.
bool separateMultiEdges() const
Returns the current setting of option separateMultiEdges.
void separateMultiEdges(bool b)
Sets the option separateMultiEdges to b.
NodeArray< SListPure< Tuple2< node, int > > > m_adjacent
The namespace for all OGDF objects.
Declaration of interface for acyclic subgraph algorithms.
bool alignBaseClasses() const
Returns the current setting of alignment of base classes (callUML only).
bool separateDeg0Layer() const
Returns the current setting of option separateDeg0Layer.
Interface of algorithms for computing a node ranking.
Definition: RankingModule.h:45
bool m_separateMultiEdges
Separate multi-edges?