Takes an acyclic connected non-upward-planar graph and planarizes it, i.e., we obtain an upward-planar graph where crossings are represented via dummy vertices. More...
#include <ogdf/upward/SubgraphUpwardPlanarizer.h>
Public Member Functions | |
SubgraphUpwardPlanarizer () | |
Creates an instance of subgraph planarizer. | |
int | runs () |
void | runs (int n) |
void | setAcyclicSubgraphModule (AcyclicSubgraphModule *acyclicMod) |
Sets the module option for acyclic subgraph module. | |
void | setInserter (UpwardEdgeInserterModule *pInserter) |
Sets the module option for the edge insertion module. | |
void | setSubgraph (FUPSModule *FUPS) |
Sets the module option for the computation of the feasible upward planar subgraph. | |
Public Member Functions inherited from ogdf::UpwardPlanarizerModule | |
UpwardPlanarizerModule () | |
Initializes an upward planarizer module. | |
virtual | ~UpwardPlanarizerModule () |
ReturnType | call (UpwardPlanRep &UPR, const EdgeArray< int > *cost=nullptr, const EdgeArray< bool > *forbid=nullptr) |
Computes a upward planarized representation (UPR) of the input graph G. | |
ReturnType | operator() (UpwardPlanRep &UPR, const EdgeArray< int > *cost=nullptr, const EdgeArray< bool > *forbid=nullptr) |
Computes a upward planarized representation of the input graph (shorthand for call) | |
bool | useCost () const |
Returns true iff edge costs are given. | |
bool | useForbid () const |
Returns true iff forbidden edges are given. | |
Public Member Functions inherited from ogdf::Module | |
Module () | |
Initializes a module. | |
virtual | ~Module () |
Protected Member Functions | |
virtual ReturnType | doCall (UpwardPlanRep &UPR, const EdgeArray< int > &cost, const EdgeArray< bool > &forbid) override |
Computes an upward planarized representation of the input graph. | |
Protected Attributes | |
std::unique_ptr< AcyclicSubgraphModule > | m_acyclicMod |
The acyclic subgraph module. | |
std::unique_ptr< UpwardEdgeInserterModule > | m_inserter |
The edge insertion module. | |
int | m_runs |
std::unique_ptr< FUPSModule > | m_subgraph |
The upward planar subgraph algorithm. | |
Private Member Functions | |
void | constructComponentGraphs (BCTree &BC, NodeArray< GraphCopy > &biComps) |
void | dfsMerge (const GraphCopy &GC, BCTree &BC, NodeArray< GraphCopy > &biComps, NodeArray< UpwardPlanRep > &uprs, UpwardPlanRep &UPR_res, node parent_BC, node current_BC, NodeArray< bool > &nodesDone) |
traversion the BTree and merge the component to a common graph | |
void | merge (const GraphCopy &GC, UpwardPlanRep &UPR_res, const GraphCopy &block, UpwardPlanRep &UPR) |
add UPR to UPR_res. | |
Additional Inherited Members | |
Public Types inherited from ogdf::Module | |
enum class | ReturnType { Feasible , Optimal , NoFeasibleSolution , TimeoutFeasible , TimeoutInfeasible , Error } |
The return type of a module. More... | |
Static Public Member Functions inherited from ogdf::Module | |
static bool | isSolution (ReturnType ret) |
Returns true iff ret indicates that the module returned a feasible solution. | |
Takes an acyclic connected non-upward-planar graph and planarizes it, i.e., we obtain an upward-planar graph where crossings are represented via dummy vertices.
The code corresponds to the following paper by Hoi-Ming Wong:
M. Chimani, C. Gutwenger, P. Mutzel, H.-M. Wong. Layer-Free Upward Crossing Minimization. ACM Journal of Experimental Algorithmics, Vol. 15, Art.No. 2.2, 27 pages, ACM, 2010.
Example for Input "Graph G":
Definition at line 67 of file SubgraphUpwardPlanarizer.h.
|
inline |
Creates an instance of subgraph planarizer.
Definition at line 70 of file SubgraphUpwardPlanarizer.h.
|
private |
|
private |
traversion the BTree and merge the component to a common graph
|
overrideprotectedvirtual |
Computes an upward planarized representation of the input graph.
UPR | represents the input graph as well as the computed upward planarized representation after the call. The original graph of UPR has to be the input graph G. Crossings are replaced by dummy vertices. The UPR is finaly augmented to a st-graph. Since this augmentation, crossings dummies may not got an in- and outdegree of 2! |
cost | points to an edge array that gives the cost of each edge. If cost = 0, all edges have cost 1. |
forbid | points to an edge array indicating which edges are not allowed to be crossed, i.e., (*forbid)[e] = true. If forbid = 0, no edges are forbidden. |
Implements ogdf::UpwardPlanarizerModule.
|
private |
add UPR to UPR_res.
|
inline |
Definition at line 89 of file SubgraphUpwardPlanarizer.h.
Definition at line 91 of file SubgraphUpwardPlanarizer.h.
|
inline |
Sets the module option for acyclic subgraph module.
Definition at line 85 of file SubgraphUpwardPlanarizer.h.
|
inline |
Sets the module option for the edge insertion module.
Definition at line 82 of file SubgraphUpwardPlanarizer.h.
|
inline |
Sets the module option for the computation of the feasible upward planar subgraph.
Definition at line 79 of file SubgraphUpwardPlanarizer.h.
|
protected |
The acyclic subgraph module.
Definition at line 99 of file SubgraphUpwardPlanarizer.h.
|
protected |
The edge insertion module.
Definition at line 98 of file SubgraphUpwardPlanarizer.h.
|
protected |
Definition at line 100 of file SubgraphUpwardPlanarizer.h.
|
protected |
The upward planar subgraph algorithm.
Definition at line 97 of file SubgraphUpwardPlanarizer.h.