Open
Graph Drawing
Framework

 v.2012.05
 

OptimalRanking.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  
00044 #ifdef _MSC_VER
00045 #pragma once
00046 #endif
00047 
00048 #ifndef OGDF_OPTIMAL_RANKING_H
00049 #define OGDF_OPTIMAL_RANKING_H
00050 
00051 
00052 
00053 #include <ogdf/module/RankingModule.h>
00054 #include <ogdf/module/AcyclicSubgraphModule.h>
00055 #include <ogdf/basic/ModuleOption.h>
00056 #include <ogdf/basic/NodeArray.h>
00057 
00058 
00059 namespace ogdf {
00060 
00062 
00091 class OGDF_EXPORT OptimalRanking : public RankingModule {
00092 
00093     ModuleOption<AcyclicSubgraphModule> m_subgraph; // option for acyclic sugraph
00094     bool m_separateMultiEdges;
00095 
00096 public:
00098     OptimalRanking();
00099 
00100 
00106 
00107     void call(const Graph &G, NodeArray<int> &rank);
00108 
00110 
00115     void call(const Graph &G, const EdgeArray<int> &length, NodeArray<int> &rank);
00116 
00118 
00124     void call(
00125         const Graph &G,
00126         const EdgeArray<int> &length,
00127         const EdgeArray<int> &cost,
00128         NodeArray<int> &rank);
00129 
00130 
00136 
00137 
00142     bool separateMultiEdges() const { return m_separateMultiEdges; }
00143 
00145     void separateMultiEdges(bool b) { m_separateMultiEdges = b; }
00146 
00147 
00153 
00154     void setSubgraph(AcyclicSubgraphModule *pSubgraph) {
00155         m_subgraph.set(pSubgraph);
00156     }
00157 
00159 
00160 private:
00162     void doCall(const Graph& G,
00163         NodeArray<int> &rank,
00164         EdgeArray<bool> &reversed,
00165         const EdgeArray<int> &length,
00166         const EdgeArray<int> &cost);
00167 };
00168 
00169 
00170 } // end namespace ogdf
00171 
00172 
00173 #endif