50class PartialSolutionFilter;
81 m_branchStack.
push(
true);
87 : m_epp(G, mode), m_solver(s) {
88 m_branchStack.
push(
true);
95 bool finished()
const {
return m_branchStack.empty(); }
120 int m_processedNodes = 0;
153 return test(OneplanMode::Normal, G, out);
172 return test(OneplanMode::IC, G, out);
189 return test(OneplanMode::NIC, G, out);
196 std::vector<std::unique_ptr<PartialSolutionFilter>>
m_filters;
Partial solutions for backtracking 1-Planarity.
Declares base class for all module types.
Declaration of the OnePlanarization class.
Declares base class for modules with timeout functionality.
Basic declarations, included by all source files.
Data type for general directed graphs (adjacency list representation).
ReturnType
The return type of a module.
class for timeout funtionality.
A partial solution for a 1-Planarity instance, representing a node in the backtracking tree.
A class representing one depth-first search in the backtracking tree.
DFSThread(const Graph &G, OneplanMode mode, OnePlanarityBacktracking *s)
Creates a new DFS-thread associated with s and initializes it with a new EdgePairPartition for G with...
EdgePairPartition m_epp
The current partial solution considered by the DFSThread.
OnePlanarityBacktracking * m_solver
The associated solver.
bool finished() const
Returns whether the DFS-thread has terminated.
bool branch()
Computes the children of the current node in the search tree using Kuratowski-subdivisions.
void cleanUp(DFSThread &thread)
Proceeds to the next child if there are any left, otherwise reverts the changes to the partial soluti...
DFSThread(EdgePairPartition &x, OnePlanarityBacktracking *s)
Creates a new DFS-thread associated with s that starts with a copy of x.
bool nextStep()
Executes one step of the DFS and returns true if a solution was found.
std::stack< bool > m_branchStack
The DFS-stack. True indicates that new branches should be computed, false means that the changes in t...
A backtracking implementation for the 1-Planarity problem.
int processedNodes() const
Returns the number of search tree nodes that were processed in the previous run.
Module::ReturnType testOnePlanarity(const Graph &G, OnePlanarization *out=nullptr)
Tests whether G is 1-planar.
void push(DFSThread *t, EdgePairPartition *epp)
Creates a new DFS-thread for epp if there is space, otherwise pushes it to t.
std::list< DFSThread > m_threads
virtual ~OnePlanarityBacktracking()
Module::ReturnType testNICPlanarity(const Graph &G, OnePlanarization *out=nullptr)
Tests whether G is NIC-Planar.
Module::ReturnType testICPlanarity(const Graph &G, OnePlanarization *out=nullptr)
Tests whether G is IC-Planar.
NodeStatus verifyNode(EdgePairPartition *epp)
Determines whether a partial solution is a solution, non-realizable, or the search must continue.
OnePlanarityBacktracking(int maxThreads=1000, int maxKuratowskis=1000)
Creates a new solver.
NodeStatus
Classification of partial solutions in the search tree.
OnePlanarityBacktracking & operator=(const OnePlanarityBacktracking &)=delete
Module::ReturnType test(OneplanMode mode, const Graph &G, OnePlanarization *out=nullptr)
Runs the backtracking on G and writes the solution to out.
OnePlanarityBacktracking(const OnePlanarityBacktracking &)=delete
std::vector< std::unique_ptr< PartialSolutionFilter > > m_filters
int m_maxExtractedKuratowskis
The graph corresponding to a partial solution for the 1-Planarity problem.
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF dynamic library (shared object / DLL),...
OneplanMode
The different modes for 1-Planarity.
The namespace for all OGDF objects.