48namespace planar_separators {
87using namespace planar_separators;
131 std::shared_ptr<BFSTreeHP>
tree;
229 int regionSize)
const;
254 const Ring& outer)
const;
291namespace planar_separators {
336 nodes.pushBack(startNode);
346 while (separator.
ringOut[startNode].search(outP) == separator.
ringOut[startNode].end()) {
351 nextEntry = separator.
ringOut[startNode].front();
356 while (next != startNode) {
357 nodes.pushBack(next);
361 if (separator.
ringOut[next].size() > 1) {
364 while (separator.
ringOut[next].search(candidate) == separator.
ringOut[next].end()) {
367 nextEntry = candidate;
368 }
else if (separator.
ringOut[next].size() == 1) {
369 nextEntry = separator.
ringOut[next].front();
405 while (adjIt !=
entries.cend() && (*adjIt)->theNode() !=
out) {
411 while ((*adjIt)->theNode() !=
out && adjIt !=
entries.cend()) {
414 while (adjIt !=
entries.cend()) {
Declaration and implementation of Array class and Array algorithms.
Declaration of CombinatorialEmbedding and face.
Includes declaration of graph class.
Declaration of doubly linked lists and iterators.
Declaration of base class of all planar separator algorithms.
Basic declarations, included by all source files.
Class for adjacency list elements.
adjEntry twin() const
Returns the corresponding adjacency element associated with the same edge.
adjEntry cyclicSucc() const
Returns the cyclic successor in the adjacency list.
node twinNode() const
Returns the associated node of the corresponding adjacency entry (shorthand for twin()->theNode()).
node theNode() const
Returns the node whose adjacency list contains this element.
The parameterized class Array implements dynamic arrays of type E.
Combinatorial embeddings of planar graphs.
Class for the representation of edges.
RegisteredArray for labeling the faces of a CombinatorialEmbedding.
Copies of graphs supporting edge splitting.
Data type for general directed graphs (adjacency list representation).
Doubly linked lists (maintaining the length of the list).
iterator pushBack(const E &x)
Adds element x at the end of the list.
const_iterator cbegin() const
Returns a const iterator to the first element of the list.
Class for the representation of nodes.
Abstract description of all planar separator algorithms.
Computes planar separators according to Har-Peled.
std::shared_ptr< BFSTreeHP > tree
A special tree that can be reconstructed, see above.
virtual void reset() override
Resets all fields, clears lists and re-initializes arrays to enable reuse of the module.
edge findSeparatorEdge() const
Finds a non-tree edge that, together with the tree, forms a (possibly too large) 2/3-separator.
virtual bool doSeparate(const Graph &G, List< node > &separator, List< node > &first, List< node > &second) override
Entry point for the core of the algorithm.
NodeArray< List< adjEntry > > ringIn
hold for every node the segment of the border between levels i-1 and i that runs through this node (t...
List< List< face > > faceFrontiers
virtual void makeTree()
Constructs the BFSTreeHP from a random node.
void findFaceLevels(const node root)
Performs a BFS over the faces of the embedding (more or less) to assign a level to each face and find...
void walkAlongRing(const Ring &ring, bool firstSection, bool invert, EdgeArray< bool > ®ionBorder, List< node > ®ion) const
Used in region construction: Walks along a Ring and stores nodes and edges of the section.
virtual std::string getSpecificName() const override
Returns the unique name of the core algorithm, to be combined with postprocessors later.
void buildRings(const Cycle &cycle)
Constructs the array of concentric rings of nodes formed by the (potentially partial) borders of the ...
SeparatorHarPeled()
Constructor.
virtual double getMaxSeparatorSize(int n) const override
Provides the maximal separator size that this algorithm guarantees as a function of the number of nod...
NodeArray< List< adjEntry > > ringOut
bool constructK(List< node > ®ion, const Cycle &cycle, const Ring &inner, const Ring &outer) const
Builds the region K.
void createDual(Graph &Dual, EdgeArray< edge > &oldEdge) const
Creates the dual of the graph to help find a separator edge.
FaceArray< int > faceLevels
bool findRegions(List< node > ®ion, const Cycle &cycle, const Ring &inner, int outerIdx) const
Finds the regions R1 and R2 formed by the separator cycle and an inner and outer ring.
void verifyRing(const Ring &ring) const
int find_i0(int delta) const
Finds i0, the first step of the first "ladder" of rings that is not larger than n / delta nodes.
bool finalize(std::string exit, const List< node > ®ion, List< node > &separator, List< node > &first, List< node > &second)
Takes a list of nodes of the GraphCopy and removes their counterparts from the original graph,...
NodeArray< bool > isMultiNode
bool findRegion(List< node > ®ion, const Cycle &cycle, const Ring &inner, const Ring &outer, bool inside) const
Builds the region R1 or R2.
void walkAlongSeparator(node startNode, node endNode, EdgeArray< bool > ®ionBorder, List< node > ®ion) const
Used in region construction: Walks along the 2/3-separator from startNode to endNode.
bool testRegionSize(node startNode, const EdgeArray< bool > ®ionBorder, bool inside, int regionSize) const
Checks whether the inside [outside] of the region defined by regionBorder is greater or smaller than ...
NodeArray< adjEntry > mainSeparator
ConstCombinatorialEmbedding E
RegisteredArray for edges of a graph, specialized for EdgeArray<edge>.
RegisteredArray for nodes, edges and adjEntries of a graph.
Abstract BFSTree that is realized via NodeArrays.
Specialised tree representation for Har-Peled.
void construct()
Builds the tree by performing BFS search.
void reconstruct(const Cycle &cycle)
Reconstructs the tree, rooting it at root of cycle.
BFSTreeHP(GraphCopy &G, node rootNode)
Constructor.
void calculateDescendants()
Calculates the number of children of each node in the tree.
Auxiliary data structure to represent Cycles in planar graphs.
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF dynamic library (shared object / DLL),...
#define OGDF_ASSERT(expr)
Assert condition expr. See doc/build.md for more information.
The namespace for all OGDF objects.
Ring(node startNode, node endNode, adjEntry outPointer, const SeparatorHarPeled &separator)
Constructor for a full ring.
Ring(node n)
Constructor for degenerate rings.
List< adjEntry > getSectionInSeparator(bool firstSection) const
Returns a section of this ring, either the first one from in to out, or the second one from out to in...
node in
Crossing points with the main separator S: in is where S enters, out is where S leaves.
List< node > nodes
Nodes and adjEntries that form the border of the ring.
bool isDegenerate
A degenerate ring contains only one node.