Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

Loading...
Searching...
No Matches
PlanarAugmentation.h
Go to the documentation of this file.
1
32#pragma once
33
34#include <ogdf/basic/Graph.h>
35#include <ogdf/basic/List.h>
36#include <ogdf/basic/SList.h>
37#include <ogdf/basic/basic.h>
40
41namespace ogdf {
42class DynamicBCTree;
43
63public:
66
69
70protected:
77 virtual void doCall(Graph& G, List<edge>& list) override;
78
79
80private:
82 int m_nPlanarityTests = 0;
83
85 Graph* m_pGraph = nullptr;
86
88 DynamicBCTree* m_pBCTree = nullptr;
89
91 List<edge>* m_pResult = nullptr;
92
95
98
101
104
107
116
117private:
119 void augment();
120
123
131 void reduceChain(node pendant, pa_label labelOld = nullptr);
132
143
152
160 node adjToCutvertex(node v, node cutvertex = nullptr);
161
163 node findLastBefore(node pendant, node ancestor);
164
167 void deletePendant(node pendant, bool removeFromLabel = true);
168
170 void addPendant(node pendant, pa_label& label);
171
177 edge connectPendants(node pendant1, node pendant2);
178
181
183 void joinPendants(pa_label& label);
184
187
194
196 void deleteLabel(pa_label& label, bool removePendants = true);
197
203 void connectLabels(pa_label first, pa_label second);
204
206 pa_label newLabel(node cutvertex, node pendant, PALabel::StopCause whyStop);
207
217 bool findMatching(pa_label& first, pa_label& second);
218
221
228 void updateAdjNonChildren(node newBlock, SList<node>& path);
229
231 void modifyBCRoot(node oldRoot, node newRoot);
232
238 void updateNewEdges(const SList<edge>& newEdges);
239
241 void terminate();
242};
243
244}
Declaration of interface for graph augmentation algorithms.
Includes declaration of graph class.
Declaration of doubly linked lists and iterators.
Declares auxiliary structure of planar augmentation algorithms.
Declaration of singly linked lists and iterators.
Basic declarations, included by all source files.
The base class for graph augmentation algorithms.
Dynamic BC-trees.
Class for the representation of edges.
Definition Graph_d.h:364
Data type for general directed graphs (adjacency list representation).
Definition Graph_d.h:866
Doubly linked lists (maintaining the length of the list).
Definition List.h:1451
Encapsulates a pointer to a list element.
Definition List.h:113
Class for the representation of nodes.
Definition Graph_d.h:241
auxiliary class for the planar augmentation algorithm
Definition PALabel.h:47
The algorithm for planar biconnectivity augmentation (Mutzel, Fialko).
PALabel::StopCause followPath(node v, node &last)
Traverses to the root and checks several stop conditions.
void augment()
The main function for planar augmentation.
PlanarAugmentation()
Creates an instance of the planar augmentation algorithm.
List< node > m_pendants
The list of all pendants (leaves in the BC-Tree).
NodeArray< ListIterator< pa_label > > m_isLabel
The list iterator in m_labels if the node in the BC-Tree is a label.
NodeArray< SList< adjEntry > > m_adjNonChildren
Stores for each node of the bc-tree the children that have an adjacent bc-node that doesn't belong to...
List< pa_label > m_labels
The list of all labels, sorted by size (decreasing).
void updateAdjNonChildren(node newBlock, SList< node > &path)
Updates m_adjNonChildren.
bool planarityCheck(node v1, node v2)
Checks planarity for a new edge (v1, v2) in the original graph.
void connectLabels(pa_label first, pa_label second)
Inserts edges between pendants of label first and second.
NodeArray< pa_label > m_belongsTo
The label a BC-Node belongs to.
void connectInsideLabel(pa_label &label)
Connects the only pendant of label with a computed ancestor.
void deletePendant(node pendant, bool removeFromLabel=true)
Deletes the pendant pendant, and, if removeFromLabel is true, removes it from the corresponding label...
void updateNewEdges(const SList< edge > &newEdges)
Major updates caused by the new edges.
List< node > m_pendantsToDel
The list of pendants that has to be deleted after each reduceChain.
node adjToCutvertex(node v, node cutvertex=nullptr)
Returns a node that belongs to bc-node v and is adjacent to cutvertex.
void makeConnectedByPendants()
Makes the graph connected by new edges between pendants of the connected components.
node findLastBefore(node pendant, node ancestor)
Traverses from pendant to ancestor and returns the last node before ancestor on the path.
void terminate()
Cleanup.
void joinPendants(pa_label &label)
Connects all pendants of label with new edges.
void reduceChain(node pendant, pa_label labelOld=nullptr)
Traverses to the root and creates a label or updates one.
bool findMatching(pa_label &first, pa_label &second)
Finds two matching labels, so all pendants can be connected without losing planarity.
ListIterator< pa_label > insertLabel(pa_label label)
Inserts label into m_labels by decreasing order.
edge connectPendants(node pendant1, node pendant2)
Connects two pendants.
bool connectCondition(pa_label a, pa_label b)
Checks if the pendants of label a and label b can be connected without creating a new pendant.
void addPendant(node pendant, pa_label &label)
Adds pendant to label and updates the label-order.
virtual void doCall(Graph &G, List< edge > &list) override
The implementation of the algorithm call.
pa_label newLabel(node cutvertex, node pendant, PALabel::StopCause whyStop)
Creates a new label and inserts it into m_labels.
void modifyBCRoot(node oldRoot, node newRoot)
Modifies the root of the BC-Tree that newRoot replaces oldRoot.
void deleteLabel(pa_label &label, bool removePendants=true)
Deletes label.
void removeAllPendants(pa_label &label)
Removes all pendants of label.
Singly linked lists (maintaining the length of the list).
Definition SList.h:845
RegisteredArray for nodes, edges and adjEntries of a graph.
Definition Graph_d.h:659
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF dynamic library (shared object / DLL),...
Definition config.h:117
The namespace for all OGDF objects.