Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

FlowCompaction.h
Go to the documentation of this file.
1 
34 #pragma once
35 
36 #include <ogdf/basic/Graph.h>
37 #include <ogdf/basic/basic.h>
39 
40 namespace ogdf {
41 
42 class GridLayoutMapped;
43 class OrthoRep;
44 class PlanRep;
45 template<class ATYPE>
46 class CompactionConstraintGraph;
47 template<class ATYPE>
48 class MinimumEdgeDistances;
49 
52 public:
54  explicit FlowCompaction(int maxImprovementSteps = 0, int costGen = 1, int costAssoc = 1);
55 
57  void constructiveHeuristics(PlanRep& PG, OrthoRep& OR, const RoutingChannel<int>& rc,
58  GridLayoutMapped& drawing);
59 
60 
62  void improvementHeuristics(PlanRep& PG, OrthoRep& OR, const RoutingChannel<int>& rc,
63  GridLayoutMapped& drawing);
64 
66  void improvementHeuristics(PlanRep& PG, OrthoRep& OR,
67 #if 0
68  const
69 #endif
71  int originalSeparation //the input value before multiplication test for compaction improvement
72  );
73 
74  //
75  // options
76 
78  void maxImprovementSteps(int maxSteps) { m_maxImprovementSteps = maxSteps; }
79 
81  int maxImprovementSteps() const { return m_maxImprovementSteps; }
82 
84  void costGen(int c) { m_costGen = c; }
85 
87  int costGen() const { return m_costGen; }
88 
90  void costAssoc(int c) { m_costAssoc = c; }
91 
93  int costAssoc() const { return m_costAssoc; }
94 
96  void scalingSteps(int sc) { m_scalingSteps = sc; }
97 
99  void align(bool b) { m_align = b; }
100 
101 
102 private:
103  void computeCoords(CompactionConstraintGraph<int>& D, NodeArray<int>& pos,
104  bool fixZeroLength = false, bool fixVertexSize = false,
105  bool improvementHeuristics = false, bool onlyGen = false);
106  void dfsAssignPos(NodeArray<bool>& visited, NodeArray<int>& pos, node v, int x);
107 
108  // options
110  int m_costGen;
113  //int m_costCage; //!< preliminary: Carsten uses 10
116  bool m_align;
117 
120 };
121 
122 }
ogdf
The namespace for all OGDF objects.
Definition: multilevelmixer.cpp:39
Graph.h
Includes declaration of graph class.
ogdf::PlanRep
Planarized representations (of a connected component) of a graph.
Definition: PlanRep.h:69
ogdf::FlowCompaction::costAssoc
void costAssoc(int c)
sets cost of arcs in constraint graph corresponding to associations
Definition: FlowCompaction.h:90
ogdf::FlowCompaction::m_numGenSteps
int m_numGenSteps
number of steps reserved for generalization compaction
Definition: FlowCompaction.h:114
ogdf::FlowCompaction::m_maxImprovementSteps
int m_maxImprovementSteps
maximal number of improvement steps
Definition: FlowCompaction.h:109
ogdf::FlowCompaction::maxImprovementSteps
int maxImprovementSteps() const
returns option maxImprovementSteps
Definition: FlowCompaction.h:81
ogdf::FlowCompaction::m_costAssoc
int m_costAssoc
cost of arcs in constraint graph corresponding to associations
Definition: FlowCompaction.h:111
ogdf::FlowCompaction::maxImprovementSteps
void maxImprovementSteps(int maxSteps)
sets option maxImprovementSteps, which is the maximal number of steps performed by improvementHeurist...
Definition: FlowCompaction.h:78
ogdf::OrthoRep
Orthogonal representation of an embedded graph.
Definition: OrthoRep.h:225
ogdf::FlowCompaction::m_costGen
int m_costGen
cost of arcs in constraint graph corresponding to generalization
Definition: FlowCompaction.h:110
ogdf::FlowCompaction::costGen
int costGen() const
returns option costGen
Definition: FlowCompaction.h:87
ogdf::FlowCompaction::costGen
void costGen(int c)
sets cost of arcs in constraint graph corresponding to generalizations
Definition: FlowCompaction.h:84
ogdf::FlowCompaction::m_align
bool m_align
toggle if brother nodes in hierarchies should be aligned
Definition: FlowCompaction.h:116
ogdf::internal::GraphRegisteredArray
RegisteredArray for nodes, edges and adjEntries of a graph.
Definition: Graph_d.h:658
ogdf::FlowCompaction::costAssoc
int costAssoc() const
returns option costGen
Definition: FlowCompaction.h:93
ogdf::FlowCompaction::scalingSteps
void scalingSteps(int sc)
sets number of separation scaling improvement steps
Definition: FlowCompaction.h:96
ogdf::FlowCompaction::m_dualEdge
EdgeArray< edge > m_dualEdge
Definition: FlowCompaction.h:118
basic.h
Basic declarations, included by all source files.
ogdf::FlowCompaction::align
void align(bool b)
set alignment option
Definition: FlowCompaction.h:99
OGDF_EXPORT
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF DLL.
Definition: config.h:101
ogdf::FlowCompaction
represents compaction algorithm using min-cost flow in the dual of the constraint graph
Definition: FlowCompaction.h:51
ogdf::FlowCompaction::m_scalingSteps
int m_scalingSteps
number of improvement steps with decreasing separation
Definition: FlowCompaction.h:115
ogdf::GridLayoutMapped
Extends GridLayout by a grid mapping mechanism.
Definition: GridLayoutMapped.h:49
RoutingChannel.h
Declaration of class RoutingChannel which maintains required size of routing channels and separation,...
ogdf::MinimumEdgeDistances< int >
ogdf::CompactionConstraintGraph
Represents a constraint graph used for compaction.
Definition: CompactionConstraintGraph.h:120
ogdf::NodeElement
Class for the representation of nodes.
Definition: Graph_d.h:240
ogdf::FlowCompaction::m_flow
EdgeArray< int > m_flow
Definition: FlowCompaction.h:119
ogdf::FlowCompaction::m_cageExpense
bool m_cageExpense
should cageedges be more expensive than others? will be propagated to compactionConstraintGraph
Definition: FlowCompaction.h:112
ogdf::internal::EdgeArrayBase2
RegisteredArray for edges of a graph, specialized for EdgeArray<edge>.
Definition: Graph_d.h:716
ogdf::RoutingChannel< int >