Open
Graph Drawing
Framework

 v. 2020.02 (Catalpa)
 

FUPSSimple.h
Go to the documentation of this file.
1 
32 #pragma once
33 
34 #include <ogdf/upward/FUPSModule.h>
35 
36 namespace ogdf {
37 
38 
40 
41 public:
43  FUPSSimple() : m_nRuns(0) { }
44 
45  // destructor
47 
48 
49  // options
50 
52  void runs (int nRuns) {
53  m_nRuns = nRuns;
54  }
55 
57  int runs() const {
58  return m_nRuns;
59  }
60 
61 
64  {
65  adjEntry adjFound = nullptr;
66  for(adjEntry adj : v->adjEntries) {
67  if (Gamma.rightFace(adj) == f) {
68  adjFound = adj;
69  break;
70  }
71  }
72 
73  OGDF_ASSERT(Gamma.rightFace(adjFound) == f);
74 
75  return adjFound;
76  }
77 
78 protected:
79 
89  virtual Module::ReturnType doCall(UpwardPlanRep &UPR,
90  List<edge> &delEdges) override;
91 
92 
93 private:
94 
95  int m_nRuns;
96 
97  void computeFUPS(UpwardPlanRep &UPR,
98  List<edge> &delEdges);
99 
101  /*
102  * @param GC The Copy of the input graph G.
103  * @param &delEdges The deleted edges (edges of G).
104  * @param random compute a random span tree
105  * @multisource true, if the original graph got multisources. In this case, the incident edges of
106  * the source are allways included in the span tree
107  */
108  void getSpanTree(GraphCopy &GC, List<edge> &delEdges, bool random);
109 
110  /*
111  * Function use by geSpannTree to compute the spannig tree.
112  */
113  void dfs_visit(const Graph &G, edge e, NodeArray<bool> &visited, EdgeArray<bool> &treeEdges, bool random);
114 
115  // construct a merge graph with repsect to gamma and its test acyclicity
116  bool constructMergeGraph(GraphCopy &M, // copy of the original graph, muss be embedded
117  adjEntry adj_orig, // the adjEntry of the original graph, which right face is the ext. Face and adj->theNode() is the source
118  const List<edge> &del_orig); // deleted edges
119 };
120 
121 }
Interface for feasible upward planar subgraph algorithms.
Definition: FUPSModule.h:43
Data type for general directed graphs (adjacency list representation).
Definition: Graph_d.h:492
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF DLL.
Definition: config.h:99
Upward planarized representations (of a connected component) of a graph.
Definition: UpwardPlanRep.h:51
ReturnType
The return type of a module.
Definition: Module.h:51
FUPSSimple()
Creates an instance of feasible subgraph algorithm.
Definition: FUPSSimple.h:43
face rightFace(adjEntry adj) const
Returns the face to the right of adj, i.e., the face containing adj.
Declaration of Feasible Upward Planar Subgraph (FUPS) Module, an interface for subgraph computation...
Faces in a combinatorial embedding.
Class for the representation of edges.
Definition: Graph_d.h:292
Copies of graphs supporting edge splitting.
Definition: GraphCopy.h:249
Class for the representation of nodes.
Definition: Graph_d.h:169
adjEntry getAdjEntry(const CombinatorialEmbedding &Gamma, node v, face f)
return a adjEntry of node v which right face is f. Be Carefully! The adjEntry is not always unique...
Definition: FUPSSimple.h:63
int runs() const
Returns the current number of randomized runs.
Definition: FUPSSimple.h:57
The namespace for all OGDF objects.
void runs(int nRuns)
Sets the number of randomized runs to nRuns.
Definition: FUPSSimple.h:52
Combinatorial embeddings of planar graphs with modification functionality.
Class for adjacency list elements.
Definition: Graph_d.h:79
#define OGDF_ASSERT(expr)
Assert condition expr. See doc/build.md for more information.
Definition: basic.h:41
int m_nRuns
The number of runs for randomization.
Definition: FUPSSimple.h:95
internal::GraphObjectContainer< AdjElement > adjEntries
The container containing all entries in the adjacency list of this node.
Definition: Graph_d.h:200