Open
Graph Drawing
Framework

 v.2012.05
 

FeasibleUpwardPlanarSubgraph.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_FEASIBLE_UPWARD_PLANAR_SUBGRAPH_H
00048 #define OGDF_FEASIBLE_UPWARD_PLANAR_SUBGRAPH_H
00049 
00050 
00051 
00052 #include <ogdf/basic/Module.h>
00053 #include <ogdf/basic/GraphCopy.h>
00054 
00055 
00056 namespace ogdf {
00057 
00058 
00059 class OGDF_EXPORT FeasibleUpwardPlanarSubgraph : public Module
00060 {
00061 public:
00062     // construction
00063     FeasibleUpwardPlanarSubgraph() { }
00064     // destruction
00065     ~FeasibleUpwardPlanarSubgraph() { }
00066 
00067     // Computes a feasible upward planar subgraph fups with feasible a
00068     // embedding gamma. 
00069     ReturnType call(Graph &G, // connected single source graph
00070                     GraphCopy &Fups, // the feasible upward planar subgraph
00071                     adjEntry &extFaceHandle,  // the right face of this adjEntry is the ext. face of the embedded fups
00072                     List<edge> &delEdges, // the list of deleted edges (original edges)
00073                     bool multisources, // true, if the original input graph has multi sources 
00074                                        // and G is an tranformed single source graph (by introducing a super source)
00075                     int runs); // number of runs    
00076     
00077     // Computes a feasible upward planar subgraph fups with feasible a
00078     // embedding gamma. 
00079     ReturnType call(const Graph &G, 
00080                     GraphCopy &Fups, 
00081                     adjEntry &extFaceHandle, 
00082                     List<edge> &delEdges,
00083                     bool multisources);
00084 
00085     // construct a merge graph with repsect to gamma and its test acyclicity
00086     bool constructMergeGraph(GraphCopy &M, // copy of the original graph, muss be embedded
00087                             adjEntry adj_orig, // the adjEntry of the original graph, which right face is the ext. Face and adj->theNode() is the source
00088                             const List<edge> &del_orig); // deleted edges
00089 
00090 
00091     
00093     adjEntry getAdjEntry(const CombinatorialEmbedding &Gamma, node v, face f) 
00094     {       
00095         adjEntry adj = 0;
00096         forall_adj(adj, v) {            
00097             if (Gamma.rightFace(adj) == f)
00098                 break;
00099         }
00100 
00101         OGDF_ASSERT(Gamma.rightFace(adj) == f);
00102 
00103         return adj;
00104     }
00105 
00106 private:
00107     
00109     /*
00110      * @param GC The input graph.
00111      * @param &delEdges The deleted edges (original edges).
00112      * @param random compute a random span tree
00113      * @multisource true, if the original graph got multisources. In this case, the incident edges of 
00114      *  the source are allways included in the span tree
00115      */
00116     void getSpanTree(GraphCopy &GC, List<edge> &delEdges, bool random, bool multisources);
00117 
00118     /*
00119      * Function use by geSpannTree to compute the spannig tree.
00120      */
00121     void dfs_visit(const Graph &G, edge e, NodeArray<bool> &visited, EdgeArray<bool> &treeEdges, bool random);  
00122     
00123 
00124     
00125     
00126 };
00127 
00128 
00129 } // end namespace ogdf
00130 
00131 #endif