Open
Graph Drawing
Framework

 v. snapshot-2017-02-16
 

SubgraphUpwardPlanarizer.h
Go to the documentation of this file.
1 
32 #pragma once
33 
34 #include <memory>
36 #include <ogdf/module/FUPSModule.h>
40 #include <ogdf/upward/FUPSSimple.h>
44 
45 
46 namespace ogdf
47 {
48 
49 
51 {
52 
53 public:
56  {
57  m_runs = 1;
58  //set default module
59  m_subgraph.reset(new FUPSSimple());
60  m_inserter.reset(new FixedEmbeddingUpwardEdgeInserter());
61  m_acyclicMod.reset(new GreedyCycleRemoval());
62  }
63 
65  void setSubgraph(FUPSModule *FUPS) {
66  m_subgraph.reset(FUPS);
67  }
68 
71  m_inserter.reset(pInserter);
72  }
73 
76  m_acyclicMod.reset(acyclicMod);
77  }
78 
79  int runs() {return m_runs;}
80  void runs(int n) {m_runs = n;}
81 
82 protected:
83 
84  virtual ReturnType doCall(UpwardPlanRep &UPR,
85  const EdgeArray<int> &cost,
86  const EdgeArray<bool> &forbid) override;
87 
88  std::unique_ptr<FUPSModule> m_subgraph;
89  std::unique_ptr<UpwardEdgeInserterModule> m_inserter;
90  std::unique_ptr<AcyclicSubgraphModule> m_acyclicMod;
91  int m_runs;
92 
93 private:
94 
95  void constructComponentGraphs(BCTree &BC, NodeArray<GraphCopy> &biComps);
96 
98  void dfsMerge(const GraphCopy &GC,
99  BCTree &BC,
100  NodeArray<GraphCopy> &biComps,
102  UpwardPlanRep &UPR_res,
103  node parent_BC,
104  node current_BC,
105  NodeArray<bool> &nodesDone);
106 
107 
109  void merge(const GraphCopy &GC,
110  UpwardPlanRep &UPR_res,
111  const GraphCopy &block,
112  UpwardPlanRep &UPR);
113 };
114 
115 }
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:423
Declaration of Feasible Upward Planar Subgraph (FUPS) Module, an interface for subgraph computation...
Declaration of class GeedyCycleRemoval.
Static BC-trees.
Definition: BCTree.h:56
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:250
Class for the representation of nodes.
Definition: Graph_d.h:167
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.