Open
Graph Drawing
Framework

 v.2012.05
 

FUPSSimple.h
Go to the documentation of this file.
00001 /*
00002  * $Revision: 2299 $
00003  * 
00004  * last checkin:
00005  *   $Author: gutwenger $ 
00006  *   $Date: 2012-05-07 15:57:08 +0200 (Mon, 07 May 2012) $ 
00007  ***************************************************************/
00008  
00042 #ifdef _MSC_VER
00043 #pragma once
00044 #endif
00045 
00046 
00047 #ifndef OGDF_FUPS_SIMPLE_H
00048 #define OGDF_FUPS_SIMPLE_H
00049 
00050 
00051 #include <ogdf/module/FUPSModule.h>
00052 
00053 
00054 namespace ogdf {
00055 
00056 
00057 class OGDF_EXPORT FUPSSimple : public FUPSModule{
00058 
00059 public:
00061     FUPSSimple() : m_nRuns(0) {};
00062 
00063     // destructor
00064     ~FUPSSimple() {};
00065 
00066 
00067     // options
00068 
00070     void runs (int nRuns) {
00071         m_nRuns = nRuns;
00072     }
00073 
00075     int runs() const {
00076         return m_nRuns;
00077     }
00078 
00079 
00081     adjEntry getAdjEntry(const CombinatorialEmbedding &Gamma, node v, face f) 
00082     {       
00083         adjEntry adj = 0;
00084         forall_adj(adj, v) {            
00085             if (Gamma.rightFace(adj) == f)
00086                 break;
00087         }
00088 
00089         OGDF_ASSERT(Gamma.rightFace(adj) == f);
00090 
00091         return adj;
00092     }
00093 
00094 protected:  
00095 
00105     virtual Module::ReturnType doCall(UpwardPlanRep &UPR,       
00106         List<edge> &delEdges);  
00107 
00108 
00109 private:
00110     
00111     int m_nRuns;  
00112 
00113     void computeFUPS(UpwardPlanRep &UPR,        
00114                     List<edge> &delEdges);
00115 
00117     /*
00118      * @param GC The Copy of the input graph G.
00119      * @param &delEdges The deleted edges (edges of G).
00120      * @param random compute a random span tree
00121      * @multisource true, if the original graph got multisources. In this case, the incident edges of 
00122      *  the source are allways included in the span tree
00123      */
00124     void getSpanTree(GraphCopy &GC, List<edge> &delEdges, bool random);
00125 
00126     /*
00127      * Function use by geSpannTree to compute the spannig tree.
00128      */
00129     void dfs_visit(const Graph &G, edge e, NodeArray<bool> &visited, EdgeArray<bool> &treeEdges, bool random);  
00130 
00131     // construct a merge graph with repsect to gamma and its test acyclicity
00132     bool constructMergeGraph(GraphCopy &M, // copy of the original graph, muss be embedded
00133                             adjEntry adj_orig, // the adjEntry of the original graph, which right face is the ext. Face and adj->theNode() is the source
00134                             const List<edge> &del_orig); // deleted edges
00135 };
00136 
00137 }
00138 #endif