Don't import ogdf namespace
[TortoiseGit.git] / ext / OGDF / ogdf / upward / FUPSSimple.h
blob5c5856b027c114baf752b7aae83a813a8c6d9d8c
1 /*
2 * $Revision: 2523 $
4 * last checkin:
5 * $Author: gutwenger $
6 * $Date: 2012-07-02 20:59:27 +0200 (Mon, 02 Jul 2012) $
7 ***************************************************************/
9 /** \file
10 * \brief Declaration of the FastPlanarSubgraph.
12 * \author Hoi-Ming Wong
14 * \par License:
15 * This file is part of the Open Graph Drawing Framework (OGDF).
17 * \par
18 * Copyright (C)<br>
19 * See README.txt in the root directory of the OGDF installation for details.
21 * \par
22 * This program is free software; you can redistribute it and/or
23 * modify it under the terms of the GNU General Public License
24 * Version 2 or 3 as published by the Free Software Foundation;
25 * see the file LICENSE.txt included in the packaging of this file
26 * for details.
28 * \par
29 * This program is distributed in the hope that it will be useful,
30 * but WITHOUT ANY WARRANTY; without even the implied warranty of
31 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
32 * GNU General Public License for more details.
34 * \par
35 * You should have received a copy of the GNU General Public
36 * License along with this program; if not, write to the Free
37 * Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
38 * Boston, MA 02110-1301, USA.
40 * \see http://www.gnu.org/copyleft/gpl.html
41 ***************************************************************/
43 #ifdef _MSC_VER
44 #pragma once
45 #endif
48 #ifndef OGDF_FUPS_SIMPLE_H
49 #define OGDF_FUPS_SIMPLE_H
52 #include <ogdf/module/FUPSModule.h>
55 namespace ogdf {
58 class OGDF_EXPORT FUPSSimple : public FUPSModule{
60 public:
61 //! Creates an instance of feasible subgraph algorithm.
62 FUPSSimple() : m_nRuns(0) { }
64 // destructor
65 ~FUPSSimple() { }
68 // options
70 //! Sets the number of randomized runs to \a nRuns.
71 void runs (int nRuns) {
72 m_nRuns = nRuns;
75 //! Returns the current number of randomized runs.
76 int runs() const {
77 return m_nRuns;
81 //! return a adjEntry of node v which right face is f. Be Carefully! The adjEntry is not always unique.
82 adjEntry getAdjEntry(const CombinatorialEmbedding &Gamma, node v, face f)
84 adjEntry adj = 0;
85 forall_adj(adj, v) {
86 if (Gamma.rightFace(adj) == f)
87 break;
90 OGDF_ASSERT(Gamma.rightFace(adj) == f);
92 return adj;
95 protected:
97 /**
98 * \brief Computes a feasible upward planar subgraph of the input graph.
100 * @param UPR represents the feasible upward planar subgraph after the call. \a UPR has to be initialzed as a
101 * UpwardPlanRep of the input connected graph G and is modified to obtain the upward planar subgraph.
102 * The subgraph is represented as an upward planar representation.
103 * @param delEdges is the deleted edges in order to obtain the subgraph. The edges are edges of the original graph G.
104 * \return the status of the result.
106 virtual Module::ReturnType doCall(UpwardPlanRep &UPR,
107 List<edge> &delEdges);
110 private:
112 int m_nRuns; //!< The number of runs for randomization.
114 void computeFUPS(UpwardPlanRep &UPR,
115 List<edge> &delEdges);
117 //! Compute a (random) span tree of the input sT-Graph.
119 * @param GC The Copy of the input graph G.
120 * @param &delEdges The deleted edges (edges of G).
121 * @param random compute a random span tree
122 * @multisource true, if the original graph got multisources. In this case, the incident edges of
123 * the source are allways included in the span tree
125 void getSpanTree(GraphCopy &GC, List<edge> &delEdges, bool random);
128 * Function use by geSpannTree to compute the spannig tree.
130 void dfs_visit(const Graph &G, edge e, NodeArray<bool> &visited, EdgeArray<bool> &treeEdges, bool random);
132 // construct a merge graph with repsect to gamma and its test acyclicity
133 bool constructMergeGraph(GraphCopy &M, // copy of the original graph, muss be embedded
134 adjEntry adj_orig, // the adjEntry of the original graph, which right face is the ext. Face and adj->theNode() is the source
135 const List<edge> &del_orig); // deleted edges
139 #endif