Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

Loading...
Searching...
No Matches
FUPSSimple.h
Go to the documentation of this file.
1
32#pragma once
33
35#include <ogdf/basic/Graph.h>
37#include <ogdf/basic/Module.h>
38#include <ogdf/basic/basic.h>
40
41namespace ogdf {
42class GraphCopy;
43class UpwardPlanRep;
44template<class E>
45class List;
46
48public:
50 FUPSSimple() : m_nRuns(0) { }
51
52 // destructor
54
55 // options
56
58 void runs(int nRuns) { m_nRuns = nRuns; }
59
61 int runs() const { return m_nRuns; }
62
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
78protected:
88 virtual Module::ReturnType doCall(UpwardPlanRep& UPR, List<edge>& delEdges) override;
89
90
91private:
92 int m_nRuns;
93
94 void computeFUPS(UpwardPlanRep& UPR, List<edge>& delEdges);
95
97 /*
98 * @param GC The Copy of the input graph G.
99 * @param &delEdges The deleted edges (edges of G).
100 * @param random compute a random span tree
101 * @multisource true, if the original graph got multisources. In this case, the incident edges of
102 * the source are allways included in the span tree
103 */
104 void getSpanTree(GraphCopy& GC, List<edge>& delEdges, bool random);
105
106 /*
107 * Function use by geSpannTree to compute the spannig tree.
108 */
109 void dfs_visit(const Graph& G, edge e, NodeArray<bool>& visited, EdgeArray<bool>& treeEdges,
110 bool random);
111
112 // construct a merge graph with repsect to gamma and its test acyclicity
119 bool constructMergeGraph(GraphCopy& M, adjEntry adj_orig, const List<edge>& del_orig);
120};
121
122}
Declaration of CombinatorialEmbedding and face.
Declaration of Feasible Upward Planar Subgraph (FUPS) Module, an interface for subgraph computation.
Includes declaration of graph class.
Decralation of GraphElement and GraphList classes.
Declares base class for all module types.
Basic declarations, included by all source files.
Class for adjacency list elements.
Definition Graph_d.h:143
Combinatorial embeddings of planar graphs with modification functionality.
face rightFace(adjEntry adj) const
Returns the face to the right of adj, i.e., the face containing adj.
Class for the representation of edges.
Definition Graph_d.h:364
Interface for feasible upward planar subgraph algorithms.
Definition FUPSModule.h:48
virtual Module::ReturnType doCall(UpwardPlanRep &UPR, List< edge > &delEdges) override
Computes a feasible upward planar subgraph of the input graph.
bool constructMergeGraph(GraphCopy &M, adjEntry adj_orig, const List< edge > &del_orig)
void computeFUPS(UpwardPlanRep &UPR, List< edge > &delEdges)
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:64
void dfs_visit(const Graph &G, edge e, NodeArray< bool > &visited, EdgeArray< bool > &treeEdges, bool random)
int runs() const
Returns the current number of randomized runs.
Definition FUPSSimple.h:61
FUPSSimple()
Creates an instance of feasible subgraph algorithm.
Definition FUPSSimple.h:50
void runs(int nRuns)
Sets the number of randomized runs to nRuns.
Definition FUPSSimple.h:58
void getSpanTree(GraphCopy &GC, List< edge > &delEdges, bool random)
Compute a (random) span tree of the input sT-Graph.
int m_nRuns
The number of runs for randomization.
Definition FUPSSimple.h:92
Faces in a combinatorial embedding.
Copies of graphs supporting edge splitting.
Definition GraphCopy.h:390
Data type for general directed graphs (adjacency list representation).
Definition Graph_d.h:866
Doubly linked lists (maintaining the length of the list).
Definition List.h:1451
ReturnType
The return type of a module.
Definition Module.h:52
Class for the representation of nodes.
Definition Graph_d.h:241
internal::GraphObjectContainer< AdjElement > adjEntries
The container containing all entries in the adjacency list of this node.
Definition Graph_d.h:272
Upward planarized representations (of a connected component) of a graph.
RegisteredArray for edges of a graph, specialized for EdgeArray<edge>.
Definition Graph_d.h:717
RegisteredArray for nodes, edges and adjEntries of a graph.
Definition Graph_d.h:659
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF dynamic library (shared object / DLL),...
Definition config.h:117
#define OGDF_ASSERT(expr)
Assert condition expr. See doc/build.md for more information.
Definition basic.h:52
The namespace for all OGDF objects.