Open
Graph Drawing
Framework

 v.2012.05
 

ogdf::MMFixedEmbeddingInserter Class Reference

Minor-monotone edge insertion with fixed embedding. More...

#include <ogdf/planarity/MMFixedEmbeddingInserter.h>

Inheritance diagram for ogdf::MMFixedEmbeddingInserter:
ogdf::MMEdgeInsertionModule ogdf::Module

List of all members.

Public Member Functions

 MMFixedEmbeddingInserter ()
 Creates a minor-monotone fixed embedding inserter.
virtual ~MMFixedEmbeddingInserter ()
void removeReinsert (RemoveReinsertType rrOption)
 Sets the remove-reinsert option for postprocessing.
RemoveReinsertType removeReinsert () const
 Returns the current setting of the remove-reinsert option.
void percentMostCrossed (double percent)
 Sets the portion of most crossed edges used during postprocessing.
double percentMostCrossed () const
 Returns the current setting of the option percentMostCrossed.

Private Member Functions

ReturnType doCall (PlanRepExpansion &PG, const List< edge > &origEdges, const EdgeArray< bool > *forbiddenEdgeOrig)
 Implementation of algorithm call.
void constructDual (const PlanRepExpansion &PG, const CombinatorialEmbedding &E)
 Constructs the search network (extended dual graph).
void findShortestPath (const PlanRepExpansion &PG, const CombinatorialEmbedding &E, const List< node > &sources, const List< node > &targets, List< Tuple2< adjEntry, adjEntry > > &crossed, const EdgeArray< bool > *forbiddenEdgeOrig)
 Finds a shortest insertion path for an edge.
void prepareAnchorNode (PlanRepExpansion &PG, CombinatorialEmbedding &E, adjEntry &adjStart, node srcOrig)
void preprocessInsertionPath (PlanRepExpansion &PG, CombinatorialEmbedding &E, node srcOrig, node tgtOrig, List< Tuple2< adjEntry, adjEntry > > &crossed)
void insertEdge (PlanRepExpansion &PG, CombinatorialEmbedding &E, edge eOrig, node srcOrig, node tgtOrig, PlanRepExpansion::NodeSplit *nodeSplit, List< Tuple2< adjEntry, adjEntry > > &crossed)
 Inserts an edge according to a given insertion path and updates the search network.
void removeEdge (PlanRepExpansion &PG, CombinatorialEmbedding &E, edge eOrig, PlanRepExpansion::NodeSplit *nodeSplit, node &oldSrc, node &oldTgt)
 Removes the insertion path of an original edge or a node split and updates the search network.
void insertDualEdge (node vDual, adjEntry adj, const CombinatorialEmbedding &E)
 Inserts dual edges between vertex node vDual and left face of adj.
void insertDualEdges (node v, const CombinatorialEmbedding &E)
 Inserts all dual edges incident to v's dual node.
void contractSplit (PlanRepExpansion &PG, CombinatorialEmbedding &E, PlanRepExpansion::NodeSplit *nodeSplit)
 Removes a (redundant) node split consisting of a single edge.
void contractSplitIfReq (PlanRepExpansion &PG, CombinatorialEmbedding &E, node u, const PlanRepExpansion::nodeSplit nsCurrent=0)
 Reduces the insertion path of a node split at node u if required.
void convertDummy (PlanRepExpansion &PG, CombinatorialEmbedding &E, node u, node vOrig, PlanRepExpansion::nodeSplit ns)
 Converts a dummy node to a copy of an original node.
void collectAnchorNodes (node v, NodeSet &nodes, const PlanRepExpansion::NodeSplit *nsParent, const PlanRepExpansion &PG) const
 Collects all anchor nodes (including dummies) of a node.
void anchorNodes (node vOrig, NodeSet &nodes, const PlanRepExpansion &PG) const
 Returns all anchor nodes of vOrig in nnodes.
void findSourcesAndTargets (node src, node tgt, NodeSet &sources, NodeSet &targets, const PlanRepExpansion &PG) const
 Finds the set of anchor nodes of src and tgt.
node commonDummy (NodeSet &sources, NodeSet &targets)
 Returns a common dummy node in sources and targets, or 0 of no such node exists.
bool checkDualGraph (PlanRepExpansion &PG, const CombinatorialEmbedding &E) const
 Performs several consistency checks on the seach network.
bool checkSplitDeg (PlanRepExpansion &PG)
bool origOfDualForbidden (edge e, const PlanRepExpansion &PG, const EdgeArray< bool > *forbiddenEdgeOrig) const
void drawDual (const PlanRepExpansion &PG, const EdgeArray< bool > *forbiddenEdgeOrig)

Private Attributes

RemoveReinsertType m_rrOption
 The remove-reinsert option.
double m_percentMostCrossed
 The percentMostCrossed option.
Graph m_dual
 The search network (extended dual graph).
FaceArray< nodem_dualOfFace
 The node in dual corresponding to face in primal.
NodeArray< nodem_dualOfNode
 The node in dual corresponding to node in primal.
NodeArray< nodem_primalNode
 The node in PG corresponding to dual node (0 if face).
EdgeArray< adjEntrym_primalAdj
 The adjacency entry in primal graph corresponding to edge in dual.
AdjEntryArray< edgem_dualEdge
 The dual edge corresponding to crossing the adjacency entry.
EdgeArray< int > m_dualCost
 The cost of an edge in the seach network.
node m_vS
 Represents the start node for the path search.
node m_vT
 Represents the end node for the path search.
int m_maxCost
 The maximal cost of an edge in the search network + 1.
FaceSetSimplem_delFaces
FaceSetPurem_newFaces
NodeSetPurem_mergedNodes

Detailed Description

Minor-monotone edge insertion with fixed embedding.

Definition at line 67 of file MMFixedEmbeddingInserter.h.


Constructor & Destructor Documentation

Creates a minor-monotone fixed embedding inserter.

Definition at line 74 of file MMFixedEmbeddingInserter.h.


Member Function Documentation

void ogdf::MMFixedEmbeddingInserter::anchorNodes ( node  vOrig,
NodeSet nodes,
const PlanRepExpansion PG 
) const [private]

Returns all anchor nodes of vOrig in nnodes.

Parameters:
vOrigis a node in the original graph.
nodesia assigned the set of anchor nodes.
PGis the planarized expansion.

Performs several consistency checks on the seach network.

void ogdf::MMFixedEmbeddingInserter::collectAnchorNodes ( node  v,
NodeSet nodes,
const PlanRepExpansion::NodeSplit nsParent,
const PlanRepExpansion PG 
) const [private]

Collects all anchor nodes (including dummies) of a node.

Parameters:
vis the current node when traversing all copy nodes of an original node that are connected in a tree-wise manner.
nodesis assigned the set of anchor nodes.
nsParentis the parent node split.
PGis the planarized expansion.
node ogdf::MMFixedEmbeddingInserter::commonDummy ( NodeSet sources,
NodeSet targets 
) [private]

Returns a common dummy node in sources and targets, or 0 of no such node exists.

Parameters:
sourcesis a set of anchor nodes.
targetsis a set of anchor nodes.

Constructs the search network (extended dual graph).

Parameters:
PGis the planarized expansion.
Eis the corresponding embeddding.

Removes a (redundant) node split consisting of a single edge.

Parameters:
PGis the planarized expansion.
Eis the corresponding embeddding.
nodeSplitis a node split whose insertion path consists of a single edge.

Reduces the insertion path of a node split at node u if required.

The insertion path is reduced by unsplitting u if u has degree 2.

Parameters:
PGis the planarized expansion.
Eis the corresponding embeddding.
uis a node in the planarized expansion.

Converts a dummy node to a copy of an original node.

ReturnType ogdf::MMFixedEmbeddingInserter::doCall ( PlanRepExpansion PG,
const List< edge > &  origEdges,
const EdgeArray< bool > *  forbiddenEdgeOrig 
) [private, virtual]

Implementation of algorithm call.

Parameters:
PGis the input planarized expansion and will also receive the result.
origEdgesis the list of original edges (edges in the original graph of PG) that have to be inserted.
forbiddenEdgeOrigpoints to an edge array indicating if an original edge is forbidden to be crossed.

Implements ogdf::MMEdgeInsertionModule.

void ogdf::MMFixedEmbeddingInserter::drawDual ( const PlanRepExpansion PG,
const EdgeArray< bool > *  forbiddenEdgeOrig 
) [private]
void ogdf::MMFixedEmbeddingInserter::findShortestPath ( const PlanRepExpansion PG,
const CombinatorialEmbedding E,
const List< node > &  sources,
const List< node > &  targets,
List< Tuple2< adjEntry, adjEntry > > &  crossed,
const EdgeArray< bool > *  forbiddenEdgeOrig 
) [private]

Finds a shortest insertion path for an edge.

Parameters:
PGis the planarized expansion.
Eis the corresponding embeddding.
sourcesis the list of nodes in PG from where the path may start.
targetsis the list of nodes in PG where the path may end.
crossedis assigned the insertion path. For each crossed edge or node, we have a pair (adj1,adj2) in the list; in case of a crossed edge, adj1 corresponds to the crossed edge and adj2 is 0; in case of a crossed node, adj1 (adj2) is the first adjacency entry assigned to the left (right) node after the split. Additionally, the first and last element in the list specify, where the path leaves the source and enters the target node.
void ogdf::MMFixedEmbeddingInserter::findSourcesAndTargets ( node  src,
node  tgt,
NodeSet sources,
NodeSet targets,
const PlanRepExpansion PG 
) const [private]

Finds the set of anchor nodes of src and tgt.

Parameters:
srcis a node in PG representing an original node.
tgtis a node in PG representing an original node.
sourcesia assigned the set of anchor nodes of src's original node.
targetsia assigned the set of anchor nodes of tgt's original node.
PGis the planarized expansion.
void ogdf::MMFixedEmbeddingInserter::insertDualEdge ( node  vDual,
adjEntry  adj,
const CombinatorialEmbedding E 
) [private]

Inserts dual edges between vertex node vDual and left face of adj.

Parameters:
vDualis the dual node of adj's node.
adjis an adjacency entry in the planarized expansion.
Eis the corresponding embeddding.

Inserts all dual edges incident to v's dual node.

Parameters:
vis a node in the planarized expansion.
Eis the corresponding embeddding.
void ogdf::MMFixedEmbeddingInserter::insertEdge ( PlanRepExpansion PG,
CombinatorialEmbedding E,
edge  eOrig,
node  srcOrig,
node  tgtOrig,
PlanRepExpansion::NodeSplit nodeSplit,
List< Tuple2< adjEntry, adjEntry > > &  crossed 
) [private]

Inserts an edge according to a given insertion path and updates the search network.

If an orignal edge eOrig is inserted, srcOrig and tgtOrig are eOrig's source and target node, and nodeSplit is 0. If a node split is inserted, then eOrig is 0, and srcOrig and tgtOrig refer to the same node (which corresponds to the nodeSplit).

Parameters:
PGis the planarized expansion.
Eis the corresponding embeddding.
eOrigis the original edge that has to be inserted.
srcOrigis the original source node.
tgtOrigis the original target node
nodeSplitis the node split that has to be inserted.
crossedis the insertion path as described with findShortestPath().
bool ogdf::MMFixedEmbeddingInserter::origOfDualForbidden ( edge  e,
const PlanRepExpansion PG,
const EdgeArray< bool > *  forbiddenEdgeOrig 
) const [inline, private]

Definition at line 319 of file MMFixedEmbeddingInserter.h.

void ogdf::MMFixedEmbeddingInserter::percentMostCrossed ( double  percent) [inline]

Sets the portion of most crossed edges used during postprocessing.

The value is only used if the remove-reinsert option is set to rrMostCrossed. The number of edges used in postprocessing is then number of edges * percentMostCrossed() / 100.

Definition at line 94 of file MMFixedEmbeddingInserter.h.

Returns the current setting of the option percentMostCrossed.

Definition at line 99 of file MMFixedEmbeddingInserter.h.

void ogdf::MMFixedEmbeddingInserter::prepareAnchorNode ( PlanRepExpansion PG,
CombinatorialEmbedding E,
adjEntry adjStart,
node  srcOrig 
) [private]
void ogdf::MMFixedEmbeddingInserter::preprocessInsertionPath ( PlanRepExpansion PG,
CombinatorialEmbedding E,
node  srcOrig,
node  tgtOrig,
List< Tuple2< adjEntry, adjEntry > > &  crossed 
) [private]
void ogdf::MMFixedEmbeddingInserter::removeEdge ( PlanRepExpansion PG,
CombinatorialEmbedding E,
edge  eOrig,
PlanRepExpansion::NodeSplit nodeSplit,
node oldSrc,
node oldTgt 
) [private]

Removes the insertion path of an original edge or a node split and updates the search network.

Parameters:
PGis the planarized expansion.
Eis the corresponding embeddding.
eOrigis the original edge whose insertion path shall be removed.
nodeSplitis the node split whose insertion path shall be removed.
oldSrcis assigned the source node of the removed insertion path (might be changed during path removal!).
oldTgtis assigned the target node of the removed insertion path (might be changed during path removal!).

Sets the remove-reinsert option for postprocessing.

Definition at line 78 of file MMFixedEmbeddingInserter.h.

Returns the current setting of the remove-reinsert option.

Definition at line 83 of file MMFixedEmbeddingInserter.h.


Member Data Documentation

The search network (extended dual graph).

Definition at line 353 of file MMFixedEmbeddingInserter.h.

The cost of an edge in the seach network.

Definition at line 359 of file MMFixedEmbeddingInserter.h.

The dual edge corresponding to crossing the adjacency entry.

Definition at line 358 of file MMFixedEmbeddingInserter.h.

The node in dual corresponding to face in primal.

Definition at line 354 of file MMFixedEmbeddingInserter.h.

The node in dual corresponding to node in primal.

Definition at line 355 of file MMFixedEmbeddingInserter.h.

The maximal cost of an edge in the search network + 1.

Definition at line 363 of file MMFixedEmbeddingInserter.h.

The percentMostCrossed option.

Definition at line 351 of file MMFixedEmbeddingInserter.h.

The adjacency entry in primal graph corresponding to edge in dual.

Definition at line 357 of file MMFixedEmbeddingInserter.h.

The node in PG corresponding to dual node (0 if face).

Definition at line 356 of file MMFixedEmbeddingInserter.h.

The remove-reinsert option.

Definition at line 350 of file MMFixedEmbeddingInserter.h.

Represents the start node for the path search.

Definition at line 361 of file MMFixedEmbeddingInserter.h.

Represents the end node for the path search.

Definition at line 362 of file MMFixedEmbeddingInserter.h.


The documentation for this class was generated from the following file: