Open
Graph Drawing
Framework

 v. 2020.02 (Catalpa)
 

SubgraphUpwardPlanarizer.h
Go to the documentation of this file.
1 
32 #pragma once
33 
34 #include <memory>
36 #include <ogdf/upward/FUPSModule.h>
40 #include <ogdf/upward/FUPSSimple.h>
44 
45 namespace ogdf {
46 
67 {
68 
69 public:
72  {
73  m_runs = 1;
74  //set default module
75  m_subgraph.reset(new FUPSSimple());
76  m_inserter.reset(new FixedEmbeddingUpwardEdgeInserter());
77  m_acyclicMod.reset(new GreedyCycleRemoval());
78  }
79 
81  void setSubgraph(FUPSModule *FUPS) {
82  m_subgraph.reset(FUPS);
83  }
84 
87  m_inserter.reset(pInserter);
88  }
89 
92  m_acyclicMod.reset(acyclicMod);
93  }
94 
95  int runs() {return m_runs;}
96  void runs(int n) {m_runs = n;}
97 
98 protected:
99 
100  virtual ReturnType doCall(UpwardPlanRep &UPR,
101  const EdgeArray<int> &cost,
102  const EdgeArray<bool> &forbid) override;
103 
104  std::unique_ptr<FUPSModule> m_subgraph;
105  std::unique_ptr<UpwardEdgeInserterModule> m_inserter;
106  std::unique_ptr<AcyclicSubgraphModule> m_acyclicMod;
107  int m_runs;
108 
109 private:
110 
111  void constructComponentGraphs(BCTree &BC, NodeArray<GraphCopy> &biComps);
112 
114  void dfsMerge(const GraphCopy &GC,
115  BCTree &BC,
116  NodeArray<GraphCopy> &biComps,
118  UpwardPlanRep &UPR_res,
119  node parent_BC,
120  node current_BC,
121  NodeArray<bool> &nodesDone);
122 
123 
125  void merge(const GraphCopy &GC,
126  UpwardPlanRep &UPR_res,
127  const GraphCopy &block,
128  UpwardPlanRep &UPR);
129 };
130 
131 }
Takes an acyclic connected non-upward-planar graph and planarizes it, i.e., we obtain an upward-plana...
Interface for feasible upward planar subgraph algorithms.
Definition: FUPSModule.h:43
Interface for upward planarization algorithms.
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF DLL.
Definition: config.h:99
Declaration of the FUPSSimple.
Declaration of a base class for planar representations of graphs and cluster graphs.
Upward planarized representations (of a connected component) of a graph.
Definition: UpwardPlanRep.h:51
Declaration of UpwardPlanarizer Module, an interface for upward planarization algorithms.
std::unique_ptr< UpwardEdgeInserterModule > m_inserter
The edge insertion module.
std::unique_ptr< AcyclicSubgraphModule > m_acyclicMod
The acyclic subgraph module.
ReturnType
The return type of a module.
Definition: Module.h:51
void setInserter(UpwardEdgeInserterModule *pInserter)
Sets the module option for the edge insertion module.
Declaration of class BCTree.
std::unique_ptr< FUPSModule > m_subgraph
The upward planar subgraph algorithm.
Declaration of interface for edge insertion algorithms.
Dynamic arrays indexed with nodes.
Definition: Graph_d.h:438
Declaration of Feasible Upward Planar Subgraph (FUPS) Module, an interface for subgraph computation...
Declaration of class GeedyCycleRemoval.
Static BC-trees.
Definition: BCTree.h:55
Edge insertion module that inserts each edge optimally into a fixed embedding.
declaration of class FixedEmbeddingInserterOld
Copies of graphs supporting edge splitting.
Definition: GraphCopy.h:249
Class for the representation of nodes.
Definition: Graph_d.h:169
Base class of algorithms for computing a maximal acyclic subgraph.
Greedy algorithm for computing a maximal acyclic subgraph.
void setSubgraph(FUPSModule *FUPS)
Sets the module option for the computation of the feasible upward planar subgraph.
The namespace for all OGDF objects.
Declaration of interface for acyclic subgraph algorithms.
SubgraphUpwardPlanarizer()
Creates an instance of subgraph planarizer.
void setAcyclicSubgraphModule(AcyclicSubgraphModule *acyclicMod)
Sets the module option for acyclic subgraph module.