40#include <unordered_set>
50namespace planar_separators {
59 : graph {pGraph},
tree {pTree} { }
136 auto firstIt = first.
cycle.crbegin();
137 auto secondIt = second.
cycle.cbegin();
141 while (firstIt != first.
cycle.crend() && secondIt != second.
cycle.cend()
142 && *firstIt == *secondIt) {
153 for (
auto it = first.
cycle.cbegin(); *it != x; ++it) {
157 auto it = second.
cycle.cbegin();
161 for (; it != second.
cycle.cend(); ++it) {
174 if (isInCycle(adj->
theNode())) {
208 bool checkSize(
int n)
const {
return inside + cycle.
size() > 1.0 / 3.0 * n; }
Declaration of CombinatorialEmbedding and face.
Includes declaration of graph class.
Declaration of doubly linked lists and iterators.
Basic declarations, included by all source files.
Class for adjacency list elements.
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.
adjEntry faceCycleSucc() const
Returns the cyclic successor in face.
Combinatorial embeddings of planar graphs with modification functionality.
RegisteredArray for labeling the faces of a CombinatorialEmbedding.
Faces in a combinatorial embedding.
Copies of graphs supporting edge splitting.
Data type for general directed graphs (adjacency list representation).
Doubly linked lists (maintaining the length of the list).
int size() const
Returns the number of elements in the list.
iterator pushBack(const E &x)
Adds element x at the end of the list.
iterator pushFront(const E &x)
Adds element x at the beginning of the list.
E popBackRet()
Removes the last element from the list and returns it.
E popFrontRet()
Removes the first element from the list and returns it.
const_reference front() const
Returns a const reference to the first element.
const_reference back() const
Returns a const reference to the last element.
Class for the representation of nodes.
Abstract description of a Breadth First Search tree.
Helper class for SeparatorDual and SeparatorDualFC.
CycleData dfs()
Recursive Depth First Search over the faces of the dual of the graph.
std::shared_ptr< BFSTree > tree
List< std::pair< face, adjEntry > > getUnmarkedNeighbours(face f, adjEntry adj)
Finds all unmarked neighbours of a face.
std::shared_ptr< GraphCopy > graph
CombinatorialEmbedding embedding
SeparatorDualHelper(std::shared_ptr< GraphCopy > pGraph, std::shared_ptr< BFSTree > pTree)
CycleData process(face f, adjEntry adj)
Processes a face: One step of the recursion in the DFS.
#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.
@ tree
for every hyperedge e a minimal subcubic tree connecting all hypernodes incident with e together is a...
Auxiliary lightweight data structure to represent cycles.
CycleData(const Graph &G, const face f, const adjEntry adj)
Constructor.
bool isInCycle(node n)
Checks if a node lies on the cycle.
List< node > cycle
contains nodes on the cycle, starting with v, ending with u, where e = (u,v) is the initial edge
void removeTriangle(adjEntry adj)
Expands the cycle by removing a triangle.
std::unordered_set< node > nodes
CycleData(const Graph &G, CycleData &first, CycleData &second)
Constructor.
bool checkSize(int n) const
Checks the size of this cycle.
void addTriangle(adjEntry adj)
Expands the cycle by adding a triangle.
CycleData()
Empty Constructor - only used to be able to throw empty CD in case of algorithm failure.