Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

SubgraphUpwardPlanarizer.h
Go to the documentation of this file.
1 
32 #pragma once
33 
34 #include <ogdf/basic/Graph.h>
35 #include <ogdf/basic/basic.h>
38 #include <ogdf/upward/FUPSModule.h>
39 #include <ogdf/upward/FUPSSimple.h>
43 
44 #include <memory>
45 
46 namespace ogdf {
47 class BCTree;
48 class GraphCopy;
49 class UpwardPlanRep;
50 
71 public:
74  m_runs = 1;
75  //set default module
76  m_subgraph.reset(new FUPSSimple());
77  m_inserter.reset(new FixedEmbeddingUpwardEdgeInserter());
78  m_acyclicMod.reset(new GreedyCycleRemoval());
79  }
80 
82  void setSubgraph(FUPSModule* FUPS) { m_subgraph.reset(FUPS); }
83 
85  void setInserter(UpwardEdgeInserterModule* pInserter) { m_inserter.reset(pInserter); }
86 
89  m_acyclicMod.reset(acyclicMod);
90  }
91 
92  int runs() { return m_runs; }
93 
94  void runs(int n) { m_runs = n; }
95 
96 protected:
97  virtual ReturnType doCall(UpwardPlanRep& UPR, const EdgeArray<int>& cost,
98  const EdgeArray<bool>& forbid) override;
99 
100  std::unique_ptr<FUPSModule> m_subgraph;
101  std::unique_ptr<UpwardEdgeInserterModule> m_inserter;
102  std::unique_ptr<AcyclicSubgraphModule> m_acyclicMod;
103  int m_runs;
104 
105 private:
106  void constructComponentGraphs(BCTree& BC, NodeArrayP<GraphCopy>& biComps);
107 
109  void dfsMerge(const GraphCopy& GC, BCTree& BC, NodeArrayP<GraphCopy>& biComps,
110  NodeArrayP<UpwardPlanRep>& uprs, UpwardPlanRep& UPR_res, node parent_BC,
111  node current_BC, NodeArray<bool>& nodesDone);
112 
113 
115  void merge(const GraphCopy& GC, UpwardPlanRep& UPR_res, const GraphCopy& block,
116  UpwardPlanRep& UPR);
117 };
118 
119 }
ogdf
The namespace for all OGDF objects.
Definition: multilevelmixer.cpp:39
GreedyCycleRemoval.h
Declaration of class GeedyCycleRemoval.
ogdf::BCTree
Static BC-trees.
Definition: BCTree.h:60
ogdf::SubgraphUpwardPlanarizer::m_inserter
std::unique_ptr< UpwardEdgeInserterModule > m_inserter
The edge insertion module.
Definition: SubgraphUpwardPlanarizer.h:101
Graph.h
Includes declaration of graph class.
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:70
ogdf::GreedyCycleRemoval
Greedy algorithm for computing a maximal acyclic subgraph.
Definition: GreedyCycleRemoval.h:47
ogdf::SubgraphUpwardPlanarizer::setAcyclicSubgraphModule
void setAcyclicSubgraphModule(AcyclicSubgraphModule *acyclicMod)
Sets the module option for acyclic subgraph module.
Definition: SubgraphUpwardPlanarizer.h:88
UpwardEdgeInserterModule.h
Declaration of interface for edge insertion algorithms.
ogdf::GraphCopy
Copies of graphs supporting edge splitting.
Definition: GraphCopy.h:391
ogdf::SubgraphUpwardPlanarizer::runs
int runs()
Definition: SubgraphUpwardPlanarizer.h:92
ogdf::FixedEmbeddingUpwardEdgeInserter
Edge insertion module that inserts each edge optimally into a fixed embedding.
Definition: FixedEmbeddingUpwardEdgeInserter.h:48
FUPSSimple.h
Declaration of the FUPSSimple.
ogdf::SubgraphUpwardPlanarizer::m_runs
int m_runs
Definition: SubgraphUpwardPlanarizer.h:103
ogdf::SubgraphUpwardPlanarizer::setSubgraph
void setSubgraph(FUPSModule *FUPS)
Sets the module option for the computation of the feasible upward planar subgraph.
Definition: SubgraphUpwardPlanarizer.h:82
ogdf::SubgraphUpwardPlanarizer::setInserter
void setInserter(UpwardEdgeInserterModule *pInserter)
Sets the module option for the edge insertion module.
Definition: SubgraphUpwardPlanarizer.h:85
AcyclicSubgraphModule.h
Declaration of interface for acyclic subgraph algorithms.
ogdf::UpwardEdgeInserterModule
Definition: UpwardEdgeInserterModule.h:44
ogdf::FUPSSimple
Definition: FUPSSimple.h:47
ogdf::SubgraphUpwardPlanarizer::m_acyclicMod
std::unique_ptr< AcyclicSubgraphModule > m_acyclicMod
The acyclic subgraph module.
Definition: SubgraphUpwardPlanarizer.h:102
ogdf::internal::GraphRegisteredArray
RegisteredArray for nodes, edges and adjEntries of a graph.
Definition: Graph_d.h:658
ogdf::SubgraphUpwardPlanarizer::runs
void runs(int n)
Definition: SubgraphUpwardPlanarizer.h:94
basic.h
Basic declarations, included by all source files.
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:47
ogdf::SubgraphUpwardPlanarizer::SubgraphUpwardPlanarizer
SubgraphUpwardPlanarizer()
Creates an instance of subgraph planarizer.
Definition: SubgraphUpwardPlanarizer.h:73
UpwardPlanarizerModule.h
Declaration of UpwardPlanarizer Module, an interface for upward planarization algorithms.
ogdf::FUPSModule
Interface for feasible upward planar subgraph algorithms.
Definition: FUPSModule.h:48
ogdf::UpwardPlanarizerModule
Interface for upward planarization algorithms.
Definition: UpwardPlanarizerModule.h:46
ogdf::UpwardPlanRep
Upward planarized representations (of a connected component) of a graph.
Definition: UpwardPlanRep.h:57
ogdf::SubgraphUpwardPlanarizer::m_subgraph
std::unique_ptr< FUPSModule > m_subgraph
The upward planar subgraph algorithm.
Definition: SubgraphUpwardPlanarizer.h:100
ogdf::NodeElement
Class for the representation of nodes.
Definition: Graph_d.h:240
ogdf::internal::EdgeArrayBase2
RegisteredArray for edges of a graph, specialized for EdgeArray<edge>.
Definition: Graph_d.h:716