A class for modelling and solving Synchronized Planarity instances. More...
#include <ogdf/cluster/sync_plan/SyncPlan.h>
Classes | |
class | ResetIndices |
class | UndoOperation |
The information needed for undoing the changes a specific operation made to the graph while maintaining its embedding. More... | |
class | VerifyPipeBijections |
Public Types | |
enum | Result { Result::SUCCESS, Result::NOT_APPLICABLE, Result::INVALID_INSTANCE } |
The result of applying a single operation. More... | |
Public Member Functions | |
SyncPlan (Graph *g, ClusterGraph *cg, std::vector< std::pair< adjEntry, adjEntry >> *augmentation=nullptr, ClusterGraphAttributes *ga=nullptr) | |
Create a new Synchronized Planarity instance by applying the reduction from some ClusteredPlanarity instance. More... | |
SyncPlan (Graph *g, GraphAttributes *ga=nullptr) | |
Create a new Synchronized Planarity instance with a given underlying graph. More... | |
SyncPlan (Graph *sefe, Graph *work, EdgeArray< uint8_t > &edge_types) | |
Create a new SyncPlan instance using the reduction from a 2-SEFE instance with a connected shared graph. More... | |
virtual | ~SyncPlan () |
Operations used by makeReduced() for removing pipes. | |
void | makeWheel (node centre, bool update_cuts=true) |
void | contractWheel (node centre) |
Result | convertSmall (node small) |
Result | encapsulate (node g_cut) |
Result | contract (node u) |
Result | propagatePQ (node u, NodePCRotation *pct, NodePCRotation *pct_v=nullptr) |
Result | simplify (node u, const NodePCRotation *pc) |
Result | checkPCTree (node u) |
Computes an embedding tree and either applies propagatePQ() or simplify() More... | |
Result | batchSPQR () |
Methods for solving instances | |
Recompute biconnected component information after the graph was changed externally. | |
void | initComponents () |
bool | makeReduced (int check_planarity_every=0) |
Apply operations (in the order defined by the current PipeQueue) until no pipes are left. More... | |
bool | solveReduced (bool fail_fast=false) |
Solve a reduced instance, creating a combinatorial embedding of the current graph that respects all Q-constraints. More... | |
void | embed () |
Undo all operations while maintaining the current embedding to obtain an embedding of the initial graph. More... | |
Statistics | |
int | undoOperations () const |
The number of operations that need undoing. More... | |
int | getLongestSimplifyToroidalCycle () const |
Return the longest cycle length encountered in simplify toroidal. More... | |
const SyncPlanComponents & | getComponents () const |
The maintained (bi)connected components information. More... | |
PipeType | getPipeType (const Pipe *p) const |
bool | canContract (const Pipe *p) const |
Check whether a Pipe can be removed by applying contract(). More... | |
Configuration | |
Config //////////////////////////////////////////////////////////////////////////////////////////////////////// | |
bool | isAllowContractBBPipe () const |
void | setAllowContractBBPipe (bool allowContractBbPipe) |
Configure whether block-block pipes can be contracted. More... | |
bool | isIntersectTrees () const |
void | setIntersectTrees (bool intersectTrees) |
Configure whether the embedding trees of block-block pipes should be intersected before propagating. More... | |
bool | isBatchSpqr () const |
void | setBatchSpqr (bool batchSpqr) |
Configure whether embedding trees should be computed in batch by deriving them from an SPQR-tree. More... | |
Public Attributes | |
Graph *const | G |
The underlying graph. More... | |
PMatching | matchings |
Collection of all matched P-nodes and their pipes. More... | |
QPartitioning | partitions |
Collection of all Q-nodes and their partitions. More... | |
Private Member Functions | |
edge | edgeFromIndex (int idx) const |
std::function< std::ostream &(std::ostream &)> | fmtPQNode (node n, bool include_comp=true) const |
void | formatNode (node n) const |
node | nodeFromIndex (int idx) const |
void | pushUndoOperation (UndoOperation *operation) |
void | pushUndoOperationAndCheck (UndoOperation *operation) |
void | thawPipeBijection (node u, node v, const FrozenPipeBij &in, PipeBij &out) const |
bool | verifyPipeBijection (node u, node v, const FrozenPipeBij &bij) const |
Private Attributes | |
bool | allow_contract_bb_pipe = false |
Whether to allow contracting block-vertex to block-vertex pipes instead of propagating. More... | |
bool | batch_spqr = true |
Whether to apply embedding-tree based operations in batch using SPQR-tree data. More... | |
SyncPlanComponents | components |
Data structure maintaining (bi)connected components information. More... | |
SyncPlanConsistency | consistency |
Consistency checking utils. More... | |
Graph::HiddenEdgeSet | deletedEdges |
Set of all edge objects deleted during the reduction, to be restored when undoing all operations. More... | |
NodeSet | deletedNodes |
Set of all node objects deleted during the reduction. Will remain as isolated nodes within G . More... | |
EdgeArray< edge > | edge_reg |
A mapping of edge-index to edge-object used while undoing operations. More... | |
GraphAttributes * | GA |
If non-null, will be updated with debugging information from applied operations. More... | |
bool | indices_saved = false |
Whether the constructor already saved the maximum indices present in G before the reduction. More... | |
bool | intersect_trees = true |
Whether to intersect trees on block-vertex to block-vertex pipes when propagating. More... | |
NodeArray< bool > | is_wheel |
Labels nodes whether they are already part of a (Q-node-replacement) wheel. More... | |
Logger | log |
The logger to use. More... | |
int | longestSimplifyToroidalCycle = 0 |
Keeps track of the longest cycle length encountered in simplify toroidal. More... | |
NodeArray< node > | node_reg |
A mapping of node-index to node-object used while undoing operations. More... | |
List< UndoOperation * > | undo_stack |
Stack of all operations that should be undone when embedding. More... | |
Friends | |
class | EmbeddingTrees |
class | internal::UndoSimplify |
std::ostream & | operator<< (std::ostream &os, const SyncPlan &pq) |
class | SyncPlanConsistency |
class | SyncPlanDrawer |
class | SyncPlanOptions |
class | UndoContract |
class | UndoConvertSmall |
class | UndoEncapsulate |
class | UndoInitCluster |
class | UndoMakeWheel |
class | UndoPropagate |
class | UndoSimplifyToroidal |
A class for modelling and solving Synchronized Planarity instances.
This implements the algorithm described in the following paper:
An evaluation of this implementation can be found in the following paper:
For more details, see also (open access):
Definition at line 124 of file SyncPlan.h.
|
strong |
The result of applying a single operation.
Enumerator | |
---|---|
SUCCESS | |
NOT_APPLICABLE | |
INVALID_INSTANCE |
Definition at line 195 of file SyncPlan.h.
|
explicit |
Create a new Synchronized Planarity instance with a given underlying graph.
Usage:
g | the underlying graph. |
ga | optional GraphAttributes in which to store debugging information of applied operations. |
|
explicit |
Create a new Synchronized Planarity instance by applying the reduction from some ClusteredPlanarity instance.
Usage:
g | the underlying graph. |
cg | the corresponding ClusterGraph. |
augmentation | if non-null, will be assigned the edges that need to be inserted to make the graph c-connected c-plane once SyncPlan::embed() was called. |
ga | optional GraphAttributes in which to store debugging information of applied operations. |
|
explicit |
Create a new SyncPlan instance using the reduction from a 2-SEFE instance with a connected shared graph.
sefe | the 2-SEFE instance that shall be embedded. |
work | an empty graph that is used for the reduction. |
edge_types | the types of edges in sefe , 1 or 2 for either of the exclusive graphs, 3 for shared. |
|
inlinevirtual |
Definition at line 319 of file SyncPlan.h.
Result ogdf::sync_plan::SyncPlan::batchSPQR | ( | ) |
bool ogdf::sync_plan::SyncPlan::canContract | ( | const Pipe * | p | ) | const |
Check whether a Pipe can be removed by applying contract().
Computes an embedding tree and either applies propagatePQ() or simplify()
void ogdf::sync_plan::SyncPlan::contractWheel | ( | node | centre | ) |
|
private |
void ogdf::sync_plan::SyncPlan::embed | ( | ) |
Undo all operations while maintaining the current embedding to obtain an embedding of the initial graph.
|
private |
|
private |
|
inline |
The maintained (bi)connected components information.
Definition at line 404 of file SyncPlan.h.
|
inline |
Return the longest cycle length encountered in simplify toroidal.
Definition at line 401 of file SyncPlan.h.
void ogdf::sync_plan::SyncPlan::initComponents | ( | ) |
|
inline |
Definition at line 427 of file SyncPlan.h.
|
inline |
Definition at line 439 of file SyncPlan.h.
|
inline |
Definition at line 434 of file SyncPlan.h.
bool ogdf::sync_plan::SyncPlan::makeReduced | ( | int | check_planarity_every = 0 | ) |
Apply operations (in the order defined by the current PipeQueue) until no pipes are left.
void ogdf::sync_plan::SyncPlan::makeWheel | ( | node | centre, |
bool | update_cuts = true |
||
) |
|
private |
Result ogdf::sync_plan::SyncPlan::propagatePQ | ( | node | u, |
NodePCRotation * | pct, | ||
NodePCRotation * | pct_v = nullptr |
||
) |
|
inlineprivate |
Definition at line 349 of file SyncPlan.h.
|
inlineprivate |
Definition at line 340 of file SyncPlan.h.
|
inline |
Configure whether block-block pipes can be contracted.
Definition at line 430 of file SyncPlan.h.
|
inline |
Configure whether embedding trees should be computed in batch by deriving them from an SPQR-tree.
Definition at line 442 of file SyncPlan.h.
|
inline |
Configure whether the embedding trees of block-block pipes should be intersected before propagating.
Definition at line 437 of file SyncPlan.h.
Result ogdf::sync_plan::SyncPlan::simplify | ( | node | u, |
const NodePCRotation * | pc | ||
) |
bool ogdf::sync_plan::SyncPlan::solveReduced | ( | bool | fail_fast = false | ) |
Solve a reduced instance, creating a combinatorial embedding of the current graph that respects all Q-constraints.
|
private |
|
inline |
The number of operations that need undoing.
Definition at line 398 of file SyncPlan.h.
|
private |
|
friend |
Definition at line 149 of file SyncPlan.h.
|
friend |
Definition at line 143 of file SyncPlan.h.
|
friend |
|
friend |
Definition at line 125 of file SyncPlan.h.
|
friend |
Definition at line 127 of file SyncPlan.h.
|
friend |
Definition at line 129 of file SyncPlan.h.
|
friend |
Definition at line 133 of file SyncPlan.h.
|
friend |
Definition at line 135 of file SyncPlan.h.
|
friend |
Definition at line 137 of file SyncPlan.h.
|
friend |
Definition at line 139 of file SyncPlan.h.
|
friend |
Definition at line 147 of file SyncPlan.h.
|
friend |
Definition at line 141 of file SyncPlan.h.
|
friend |
Definition at line 145 of file SyncPlan.h.
|
private |
Whether to allow contracting block-vertex to block-vertex pipes instead of propagating.
Definition at line 238 of file SyncPlan.h.
|
private |
Whether to apply embedding-tree based operations in batch using SPQR-tree data.
Definition at line 242 of file SyncPlan.h.
|
private |
Data structure maintaining (bi)connected components information.
Definition at line 218 of file SyncPlan.h.
|
private |
Consistency checking utils.
Definition at line 248 of file SyncPlan.h.
|
private |
Set of all edge objects deleted during the reduction, to be restored when undoing all operations.
Definition at line 220 of file SyncPlan.h.
|
private |
Set of all node objects deleted during the reduction. Will remain as isolated nodes within G
.
Definition at line 223 of file SyncPlan.h.
A mapping of edge-index to edge-object used while undoing operations.
Definition at line 230 of file SyncPlan.h.
Graph* const ogdf::sync_plan::SyncPlan::G |
The underlying graph.
Definition at line 201 of file SyncPlan.h.
|
private |
If non-null, will be updated with debugging information from applied operations.
Definition at line 226 of file SyncPlan.h.
|
private |
Whether the constructor already saved the maximum indices present in G
before the reduction.
Definition at line 236 of file SyncPlan.h.
|
private |
Whether to intersect trees on block-vertex to block-vertex pipes when propagating.
Definition at line 240 of file SyncPlan.h.
|
private |
Labels nodes whether they are already part of a (Q-node-replacement) wheel.
Definition at line 232 of file SyncPlan.h.
|
private |
The logger to use.
Definition at line 234 of file SyncPlan.h.
|
private |
Keeps track of the longest cycle length encountered in simplify toroidal.
Definition at line 244 of file SyncPlan.h.
PMatching ogdf::sync_plan::SyncPlan::matchings |
Collection of all matched P-nodes and their pipes.
Definition at line 203 of file SyncPlan.h.
A mapping of node-index to node-object used while undoing operations.
Definition at line 228 of file SyncPlan.h.
QPartitioning ogdf::sync_plan::SyncPlan::partitions |
Collection of all Q-nodes and their partitions.
Definition at line 205 of file SyncPlan.h.
|
private |
Stack of all operations that should be undone when embedding.
Definition at line 216 of file SyncPlan.h.