Open
Graph Drawing
Framework

 v. 2025.10-dev (Foxglove)
 

Loading...
Searching...
No Matches
PartialSolutionFilter.h
Go to the documentation of this file.
1
32#pragma once
33
34#include <ogdf/basic/Graph.h>
37#include <ogdf/basic/List.h>
38#include <ogdf/basic/basic.h>
41
43
45
50public:
52 virtual bool canCut(OnePlanarization& pl) = 0;
53
54 virtual ~PartialSolutionFilter() = default;
55};
56
59public:
61 bool canCut(OnePlanarization& pl) override {
62 ogdf::NodeSet seenVertices(pl);
63 for (ogdf::edge e : pl.freeEdges()) {
64 seenVertices.insert(e->target());
65 seenVertices.insert(e->source());
66 }
67
68 return pl.freeEdges().size() > 4 * seenVertices.size() - 8;
69 }
70};
71
74public:
76 bool canCut(OnePlanarization& pl) override {
77 return pl.numberOfEdges() > 4 * pl.numberOfNodes() - 8;
78 }
79};
80
84 bool canCut(OnePlanarization& pl) override {
85 ogdf::GraphCopy saturatedSubgraph;
86 pl.getSaturatedSubgraph(saturatedSubgraph);
87 return !isPlanar(saturatedSubgraph);
88 }
89};
90
92
99public:
101 bool canCut(OnePlanarization& pl) override;
102
103private:
104 bool test(OnePlanarization& pl, ogdf::node crossingVertex, ogdf::NodePair cyclePair,
105 ogdf::NodePair otherPair);
106
108 static int minFreeEdgeCycle(const OnePlanarization& pl, node crossingVertex,
109 NodePair& cyclePair, NodePair& otherPair, EdgeSet& cycleEdges, NodeSet& cycleNodes);
110
113 const EdgeSet& cycleEdges, const NodeSet& cycleNodes, node& v1, node& v2);
114};
115}
Includes declaration of graph class.
Declaration of graph copy classes.
Declaration and implementation of NodeSet, EdgeSet, and AdjEntrySet classes.
Declaration of doubly linked lists and iterators.
Declaration of the OnePlanarization class.
Basic declarations, included by all source files.
Class for the representation of edges.
Definition Graph_d.h:364
Edge sets.
Definition GraphSets.h:86
Copies of graphs supporting edge splitting.
Definition GraphCopy.h:390
int numberOfNodes() const
Returns the number of nodes in the graph.
Definition Graph_d.h:979
int numberOfEdges() const
Returns the number of edges in the graph.
Definition Graph_d.h:982
Class for the representation of nodes.
Definition Graph_d.h:241
Node sets.
Definition GraphSets.h:54
int size() const
Returns the number of elements in this set.
void insert(element_type v)
Inserts element v into this set.
Rejects partial solutions for 1-Planarity if the crossable edges violate the density for 1-Planarity.
bool canCut(OnePlanarization &pl) override
Returns true if the subgraph of induced by its free edges violates the density for 1-Planarity,...
The graph corresponding to a partial solution for the 1-Planarity problem.
const EdgeSet & freeEdges() const
Returns the set of all edges that may still cross some other edge.
void getSaturatedSubgraph(GraphCopy &cp) const
Computes the subgraph induced by uncrossable edges.
Interface of filters for partial solutions for 1-Planarity.
virtual bool canCut(OnePlanarization &pl)=0
Returns true if the partial solution represented by pl can be classified as non-realizable,...
Rejects partial solutions for 1-Planarity if they are too dense.
bool canCut(OnePlanarization &pl) override
Returns true if the subgraph of pl induced by its free edges violates the density formula for 1-Plana...
Rejects partial solutions for 1-Planarity if the uncrossable edges induce a non-planar graph.
bool canCut(OnePlanarization &pl) override
Returns true if the subgraph of pl induced by its uncrossable edges is non-planar,...
Rejects partial solutions for 1-Planarity if a separating cycle with too few crossable edges is found...
static int minFreeEdgeCycle(const OnePlanarization &pl, node crossingVertex, NodePair &cyclePair, NodePair &otherPair, EdgeSet &cycleEdges, NodeSet &cycleNodes)
Searches for a path between cyclePair that is disjoint from otherPair.
bool test(OnePlanarization &pl, ogdf::node crossingVertex, ogdf::NodePair cyclePair, ogdf::NodePair otherPair)
static void contractUncrossableEdges(const OnePlanarization &pl, GraphCopy &cp, const EdgeSet &cycleEdges, const NodeSet &cycleNodes, node &v1, node &v2)
Contracts all edges of cp that cannot cross any edge of the cycle.
bool canCut(OnePlanarization &pl) override
Returns true if pl can be rejected due to a found separating cycle, false otherwise.
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF dynamic library (shared object / DLL),...
Definition config.h:118
Declaration of extended graph algorithms.
bool isPlanar(const Graph &G)
Returns true, if G is planar, false otherwise.