Multi edge inserter with approximation guarantee. More...
#include <ogdf/planarity/MultiEdgeApproxInserter.h>
Classes | |
struct | VertexBlock |
Public Member Functions | |
MultiEdgeApproxInserter () | |
Creates an instance of multi-edge approx inserter with default option settings. More... | |
MultiEdgeApproxInserter (const MultiEdgeApproxInserter &inserter) | |
Creates an instance of multi-edge approx inserter with the same settings as inserter . More... | |
~MultiEdgeApproxInserter () | |
Destructor. More... | |
virtual EdgeInsertionModule * | clone () const override |
Returns a new instance of the multi-edge approx inserter with the same option settings. More... | |
MultiEdgeApproxInserter & | operator= (const MultiEdgeApproxInserter &inserter) |
Assignment operator. Copies option settings only. More... | |
double | percentMostCrossedFix () const |
Returns the current setting of option percentMostCrossed. More... | |
void | percentMostCrossedFix (double percent) |
Sets the option percentMostCrossed to percent . More... | |
double | percentMostCrossedVar () const |
Returns the current setting of option percentMostCrossed (variable embedding). More... | |
void | percentMostCrossedVar (double percent) |
Sets the option percentMostCrossedVar to percent . More... | |
RemoveReinsertType | removeReinsertFix () const |
Returns the current setting of the remove-reinsert postprocessing method. More... | |
void | removeReinsertFix (RemoveReinsertType rrOption) |
Sets the remove-reinsert postprocessing method. More... | |
RemoveReinsertType | removeReinsertVar () const |
Returns the current setting of the remove-reinsert postprocessing method. More... | |
void | removeReinsertVar (RemoveReinsertType rrOption) |
Sets the remove-reinsert postprocessing method. More... | |
bool | statistics () const |
void | statistics (bool b) |
int | sumFEInsertionCosts () const |
int | sumInsertionCosts () const |
![]() | |
EdgeInsertionModule () | |
Initializes an edge insertion module (default constructor). More... | |
EdgeInsertionModule (const EdgeInsertionModule &eim) | |
Initializes an edge insertion module (copy constructor). More... | |
virtual | ~EdgeInsertionModule () |
Destructor. More... | |
ReturnType | call (PlanRepLight &pr, const Array< edge > &origEdges) |
Inserts all edges in origEdges into pr . More... | |
ReturnType | call (PlanRepLight &pr, const EdgeArray< bool > &forbiddenOrig, const Array< edge > &origEdges) |
Inserts all edges in origEdges with given forbidden edges into pr . More... | |
ReturnType | call (PlanRepLight &pr, const EdgeArray< int > &costOrig, const Array< edge > &origEdges) |
Inserts all edges in origEdges with given costs into pr . More... | |
ReturnType | call (PlanRepLight &pr, const EdgeArray< int > &costOrig, const Array< edge > &origEdges, const EdgeArray< uint32_t > &edgeSubGraphs) |
Inserts all edges in origEdges with given costs and subgraphs (for simultaneous drawing) into pr . More... | |
ReturnType | call (PlanRepLight &pr, const EdgeArray< int > &costOrig, const EdgeArray< bool > &forbiddenOrig, const Array< edge > &origEdges) |
Inserts all edges in origEdges with given costs and forbidden edges into pr . More... | |
ReturnType | call (PlanRepLight &pr, const EdgeArray< int > &costOrig, const EdgeArray< bool > &forbiddenOrig, const Array< edge > &origEdges, const EdgeArray< uint32_t > &edgeSubGraphs) |
Inserts all edges in origEdges with given costs, forbidden edges, and subgraphs (for simultaneous drawing) into pr . More... | |
ReturnType | callEx (PlanRepLight &pr, const Array< edge > &origEdges, const EdgeArray< int > *pCostOrig=nullptr, const EdgeArray< bool > *pForbiddenOrig=nullptr, const EdgeArray< uint32_t > *pEdgeSubGraphs=nullptr) |
Inserts all edges in origEdges into pr , optionally costs, forbidden edges, and subgraphs (for simultaneous drawing) may be given. More... | |
![]() | |
Module () | |
Initializes a module. More... | |
virtual | ~Module () |
![]() | |
Timeouter () | |
timeout is turned of by default More... | |
Timeouter (bool t) | |
timeout is turned off (false) or on (true) (with 0 second) More... | |
Timeouter (const Timeouter &t) | |
Timeouter (double t) | |
timeout is set to the given value (seconds) More... | |
~Timeouter () | |
bool | isTimeLimit () const |
returns whether any time limit is set or not More... | |
Timeouter & | operator= (const Timeouter &t) |
double | timeLimit () const |
returns the current time limit for the call More... | |
void | timeLimit (bool t) |
shorthand to turn timelimit off or on (with 0 seconds) More... | |
void | timeLimit (double t) |
sets the time limit for the call (in seconds); <0 means no limit. More... | |
Private Types | |
enum | PathDir { PathDir::Left, PathDir::Right, PathDir::None } |
Private Member Functions | |
void | cleanup () |
void | computePathBC (int k) |
int | computePathSPQR (int b, node v, node w, int k) |
MultiEdgeApproxInserter::Block * | constructBlock (int i) |
void | constructDual (const PlanRepLight &pr) |
node | copy (node vOrig, int b) |
bool | dfsPathBlock (int b, node parent, int k, node t) |
bool | dfsPathVertex (node v, int parent, int k, node t) |
ReturnType | doCall (PlanRepLight &pr, const Array< edge > &origEdges, const EdgeArray< int > *costOrig, const EdgeArray< bool > *forbiddenEdge, const EdgeArray< uint32_t > *edgeSubGraphs) override |
Implements the algorithm call. More... | |
void | embedBlock (int b, int m) |
int | findShortestPath (node s, node t) |
void | recFlipPref (adjEntry adjP, NodeArray< EmbeddingPreference > &pi_pick, const NodeArray< bool > &visited, StaticPlanarSPQRTree &spqr) |
Static Private Member Functions | |
static bool | dfsPathSPQR (node v, node v2, edge eParent, List< edge > &path) |
static PathDir | oppDir (PathDir dir) |
Returns the opposite direction of dir . More... | |
Private Attributes | |
Array< Block * > | m_block |
NodeArray< SList< int > > | m_compV |
NodeArray< SList< VertexBlock > > | m_copyInBlocks |
const EdgeArray< int > * | m_costOrig |
Graph | m_dual |
ConstCombinatorialEmbedding | m_E |
const Array< edge > * | m_edge |
Array< SList< edge > > | m_edgesB |
FaceArray< node > | m_faceNode |
NodeArray< node > | m_GtoBC |
Array< int > | m_insertionCosts |
Array< List< VertexBlock > > | m_pathBCs |
double | m_percentMostCrossedFix |
The portion of most crossed edges considered (fixed embedding). More... | |
double | m_percentMostCrossedVar |
The portion of most crossed edges considered (variable embedding). More... | |
PlanRepLight * | m_pPG |
AdjEntryArray< adjEntry > | m_primalAdj |
RemoveReinsertType | m_rrOptionFix |
The remove-reinsert method for fixed embedding. More... | |
RemoveReinsertType | m_rrOptionVar |
The remove-reinsert method for variable embedding. More... | |
bool | m_statistics |
int | m_sumFEInsertionCosts |
int | m_sumInsertionCosts |
Array< SList< node > > | m_verticesB |
node | m_vS |
node | m_vT |
Additional Inherited Members | |
![]() | |
enum | ReturnType { ReturnType::Feasible, ReturnType::Optimal, ReturnType::NoFeasibleSolution, ReturnType::TimeoutFeasible, ReturnType::TimeoutInfeasible, ReturnType::Error } |
The return type of a module. More... | |
![]() | |
static bool | isSolution (ReturnType ret) |
Returns true iff ret indicates that the module returned a feasible solution. More... | |
![]() | |
double | m_timeLimit |
Time limit for module calls (< 0 means no limit). More... | |
Multi edge inserter with approximation guarantee.
The implementation is based on the following publication:
Markus Chimani and Carsten Gutwenger: Advances in the Planarization Method: Effective Multiple Edge Insertions. Journal of Graph Algorithms and Applications (JGAA), 16(3), pp. 729-757, 2012.
Definition at line 50 of file MultiEdgeApproxInserter.h.
|
strongprivate |
Enumerator | |
---|---|
Left | |
Right | |
None |
Definition at line 128 of file MultiEdgeApproxInserter.h.
ogdf::MultiEdgeApproxInserter::MultiEdgeApproxInserter | ( | ) |
Creates an instance of multi-edge approx inserter with default option settings.
ogdf::MultiEdgeApproxInserter::MultiEdgeApproxInserter | ( | const MultiEdgeApproxInserter & | inserter | ) |
Creates an instance of multi-edge approx inserter with the same settings as inserter
.
|
inline |
Destructor.
Definition at line 60 of file MultiEdgeApproxInserter.h.
|
private |
|
overridevirtual |
Returns a new instance of the multi-edge approx inserter with the same option settings.
Implements ogdf::EdgeInsertionModule.
|
private |
|
private |
|
private |
|
staticprivate |
|
overrideprivatevirtual |
Implements the algorithm call.
Implements ogdf::EdgeInsertionModule.
|
private |
MultiEdgeApproxInserter& ogdf::MultiEdgeApproxInserter::operator= | ( | const MultiEdgeApproxInserter & | inserter | ) |
Assignment operator. Copies option settings only.
Returns the opposite direction of dir
.
Definition at line 131 of file MultiEdgeApproxInserter.h.
|
inline |
Returns the current setting of option percentMostCrossed.
Definition at line 98 of file MultiEdgeApproxInserter.h.
|
inline |
Sets the option percentMostCrossed to percent
.
This option determines the portion of most crossed edges used if the remove-reinsert method is set to RemoveReinsertType::MostCrossed. This portion is number of edges * percentMostCrossed() / 100.
Definition at line 93 of file MultiEdgeApproxInserter.h.
|
inline |
Returns the current setting of option percentMostCrossed (variable embedding).
Definition at line 112 of file MultiEdgeApproxInserter.h.
|
inline |
Sets the option percentMostCrossedVar to percent
.
This option determines the portion of most crossed edges used if the remove-reinsert method (variable embedding) is set to RemoveReinsertType::MostCrossed. This portion is number of edges * percentMostCrossed() / 100.
Definition at line 107 of file MultiEdgeApproxInserter.h.
|
private |
|
inline |
Returns the current setting of the remove-reinsert postprocessing method.
Definition at line 74 of file MultiEdgeApproxInserter.h.
|
inline |
Sets the remove-reinsert postprocessing method.
Definition at line 69 of file MultiEdgeApproxInserter.h.
|
inline |
Returns the current setting of the remove-reinsert postprocessing method.
Definition at line 84 of file MultiEdgeApproxInserter.h.
|
inline |
Sets the remove-reinsert postprocessing method.
Definition at line 79 of file MultiEdgeApproxInserter.h.
|
inline |
Definition at line 120 of file MultiEdgeApproxInserter.h.
|
inline |
Definition at line 116 of file MultiEdgeApproxInserter.h.
|
inline |
Definition at line 125 of file MultiEdgeApproxInserter.h.
|
inline |
Definition at line 124 of file MultiEdgeApproxInserter.h.
Definition at line 196 of file MultiEdgeApproxInserter.h.
Definition at line 187 of file MultiEdgeApproxInserter.h.
|
private |
Definition at line 191 of file MultiEdgeApproxInserter.h.
|
private |
Definition at line 185 of file MultiEdgeApproxInserter.h.
|
private |
Definition at line 207 of file MultiEdgeApproxInserter.h.
|
private |
Definition at line 206 of file MultiEdgeApproxInserter.h.
Definition at line 193 of file MultiEdgeApproxInserter.h.
Definition at line 189 of file MultiEdgeApproxInserter.h.
Definition at line 208 of file MultiEdgeApproxInserter.h.
Definition at line 190 of file MultiEdgeApproxInserter.h.
|
private |
Definition at line 195 of file MultiEdgeApproxInserter.h.
|
private |
Definition at line 194 of file MultiEdgeApproxInserter.h.
|
private |
The portion of most crossed edges considered (fixed embedding).
Definition at line 180 of file MultiEdgeApproxInserter.h.
|
private |
The portion of most crossed edges considered (variable embedding).
Definition at line 181 of file MultiEdgeApproxInserter.h.
|
private |
Definition at line 184 of file MultiEdgeApproxInserter.h.
|
private |
Definition at line 209 of file MultiEdgeApproxInserter.h.
|
private |
The remove-reinsert method for fixed embedding.
Definition at line 178 of file MultiEdgeApproxInserter.h.
|
private |
The remove-reinsert method for variable embedding.
Definition at line 179 of file MultiEdgeApproxInserter.h.
|
private |
Definition at line 182 of file MultiEdgeApproxInserter.h.
|
private |
Definition at line 200 of file MultiEdgeApproxInserter.h.
|
private |
Definition at line 199 of file MultiEdgeApproxInserter.h.
Definition at line 188 of file MultiEdgeApproxInserter.h.
|
private |
Definition at line 210 of file MultiEdgeApproxInserter.h.
|
private |
Definition at line 210 of file MultiEdgeApproxInserter.h.