Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

SubgraphUpwardPlanarizer.h
Go to the documentation of this file.
1 
32 #pragma once
33 
37 #include <ogdf/upward/FUPSModule.h>
38 #include <ogdf/upward/FUPSSimple.h>
43 
44 #include <memory>
45 
46 namespace ogdf {
47 
68 public:
71  m_runs = 1;
72  //set default module
73  m_subgraph.reset(new FUPSSimple());
74  m_inserter.reset(new FixedEmbeddingUpwardEdgeInserter());
75  m_acyclicMod.reset(new GreedyCycleRemoval());
76  }
77 
79  void setSubgraph(FUPSModule* FUPS) { m_subgraph.reset(FUPS); }
80 
82  void setInserter(UpwardEdgeInserterModule* pInserter) { m_inserter.reset(pInserter); }
83 
86  m_acyclicMod.reset(acyclicMod);
87  }
88 
89  int runs() { return m_runs; }
90 
91  void runs(int n) { m_runs = n; }
92 
93 protected:
94  virtual ReturnType doCall(UpwardPlanRep& UPR, const EdgeArray<int>& cost,
95  const EdgeArray<bool>& forbid) override;
96 
97  std::unique_ptr<FUPSModule> m_subgraph;
98  std::unique_ptr<UpwardEdgeInserterModule> m_inserter;
99  std::unique_ptr<AcyclicSubgraphModule> m_acyclicMod;
100  int m_runs;
101 
102 private:
103  void constructComponentGraphs(BCTree& BC, NodeArrayP<GraphCopy>& biComps);
104 
106  void dfsMerge(const GraphCopy& GC, BCTree& BC, NodeArrayP<GraphCopy>& biComps,
107  NodeArrayP<UpwardPlanRep>& uprs, UpwardPlanRep& UPR_res, node parent_BC,
108  node current_BC, NodeArray<bool>& nodesDone);
109 
110 
112  void merge(const GraphCopy& GC, UpwardPlanRep& UPR_res, const GraphCopy& block,
113  UpwardPlanRep& UPR);
114 };
115 
116 }
ogdf
The namespace for all OGDF objects.
Definition: AugmentationModule.h:36
GreedyCycleRemoval.h
Declaration of class GeedyCycleRemoval.
ogdf::BCTree
Static BC-trees.
Definition: BCTree.h:55
ogdf::SubgraphUpwardPlanarizer::m_inserter
std::unique_ptr< UpwardEdgeInserterModule > m_inserter
The edge insertion module.
Definition: SubgraphUpwardPlanarizer.h:98
FixedEmbeddingUpwardEdgeInserter.h
declaration of class FixedEmbeddingInserterOld
ogdf::SubgraphUpwardPlanarizer
Takes an acyclic connected non-upward-planar graph and planarizes it, i.e., we obtain an upward-plana...
Definition: SubgraphUpwardPlanarizer.h:67
ogdf::GreedyCycleRemoval
Greedy algorithm for computing a maximal acyclic subgraph.
Definition: GreedyCycleRemoval.h:44
ogdf::SubgraphUpwardPlanarizer::setAcyclicSubgraphModule
void setAcyclicSubgraphModule(AcyclicSubgraphModule *acyclicMod)
Sets the module option for acyclic subgraph module.
Definition: SubgraphUpwardPlanarizer.h:85
UpwardEdgeInserterModule.h
Declaration of interface for edge insertion algorithms.
UpwardPlanRep.h
Declaration of a base class for planar representations of graphs and cluster graphs.
ogdf::GraphCopy
Copies of graphs supporting edge splitting.
Definition: GraphCopy.h:384
ogdf::SubgraphUpwardPlanarizer::runs
int runs()
Definition: SubgraphUpwardPlanarizer.h:89
ogdf::FixedEmbeddingUpwardEdgeInserter
Edge insertion module that inserts each edge optimally into a fixed embedding.
Definition: FixedEmbeddingUpwardEdgeInserter.h:41
FUPSSimple.h
Declaration of the FUPSSimple.
ogdf::SubgraphUpwardPlanarizer::m_runs
int m_runs
Definition: SubgraphUpwardPlanarizer.h:100
ogdf::SubgraphUpwardPlanarizer::setSubgraph
void setSubgraph(FUPSModule *FUPS)
Sets the module option for the computation of the feasible upward planar subgraph.
Definition: SubgraphUpwardPlanarizer.h:79
ogdf::SubgraphUpwardPlanarizer::setInserter
void setInserter(UpwardEdgeInserterModule *pInserter)
Sets the module option for the edge insertion module.
Definition: SubgraphUpwardPlanarizer.h:82
AcyclicSubgraphModule.h
Declaration of interface for acyclic subgraph algorithms.
BCTree.h
Declaration of class BCTree.
ogdf::UpwardEdgeInserterModule
Definition: UpwardEdgeInserterModule.h:39
ogdf::FUPSSimple
Definition: FUPSSimple.h:39
ogdf::SubgraphUpwardPlanarizer::m_acyclicMod
std::unique_ptr< AcyclicSubgraphModule > m_acyclicMod
The acyclic subgraph module.
Definition: SubgraphUpwardPlanarizer.h:99
ogdf::internal::GraphRegisteredArray
RegisteredArray for nodes, edges and adjEntries of a graph.
Definition: Graph_d.h:651
ogdf::SubgraphUpwardPlanarizer::runs
void runs(int n)
Definition: SubgraphUpwardPlanarizer.h:91
OGDF_EXPORT
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF DLL.
Definition: config.h:101
FUPSModule.h
Declaration of Feasible Upward Planar Subgraph (FUPS) Module, an interface for subgraph computation.
ogdf::AcyclicSubgraphModule
Base class of algorithms for computing a maximal acyclic subgraph.
Definition: AcyclicSubgraphModule.h:43
ogdf::SubgraphUpwardPlanarizer::SubgraphUpwardPlanarizer
SubgraphUpwardPlanarizer()
Creates an instance of subgraph planarizer.
Definition: SubgraphUpwardPlanarizer.h:70
UpwardPlanarizerModule.h
Declaration of UpwardPlanarizer Module, an interface for upward planarization algorithms.
ogdf::FUPSModule
Interface for feasible upward planar subgraph algorithms.
Definition: FUPSModule.h:43
ogdf::UpwardPlanarizerModule
Interface for upward planarization algorithms.
Definition: UpwardPlanarizerModule.h:43
ogdf::UpwardPlanRep
Upward planarized representations (of a connected component) of a graph.
Definition: UpwardPlanRep.h:50
ogdf::SubgraphUpwardPlanarizer::m_subgraph
std::unique_ptr< FUPSModule > m_subgraph
The upward planar subgraph algorithm.
Definition: SubgraphUpwardPlanarizer.h:97
ogdf::NodeElement
Class for the representation of nodes.
Definition: Graph_d.h:233
ogdf::internal::EdgeArrayBase2
RegisteredArray for edges of a graph, specialized for EdgeArray<edge>.
Definition: Graph_d.h:709