Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

UpSAT.h
Go to the documentation of this file.
1 
34 #pragma once
35 
36 #include <ogdf/basic/Graph.h>
37 #include <ogdf/basic/Graph_d.h>
38 #include <ogdf/basic/HashArray.h>
39 #include <ogdf/basic/List.h>
42 
43 #include <ogdf/external/Minisat.h>
44 
45 #include <vector>
46 
47 namespace ogdf {
48 
49 class UpSAT {
50 public:
51  //constructor
52  explicit UpSAT(Graph& G);
54 
55 private:
56  class Comp;
57  //FLAGS
59  //copy of the input graph
61  //number of clauses and variables
63  long long numberOfClauses;
64  //Indices of the nodes and edges of m_G
67  //Dominating edges-pairs
69  //Variables of the formulation(s)
70  std::vector<std::vector<int>> tau;
71  std::vector<std::vector<int>> sigma;
72  std::vector<std::vector<int>> mu;
73  //Formula
75 
76 public:
77  bool testUpwardPlanarity(NodeArray<int>* nodeOrder = nullptr);
78  bool embedUpwardPlanar(adjEntry& externalToItsRight, NodeArray<int>* nodeOrder = nullptr);
79  long long getNumberOfClauses();
81  void reset();
82 
83 private:
85  void computeTauVariables();
86  void computeSigmaVariables();
87  void computeMuVariables();
88  void ruleTauTransitive();
89  void ruleSigmaTransitive();
90  void ruleUpward();
91  void rulePlanarity();
92  void ruleTutte();
93  void ruleFixed(const Minisat::Model& model);
94  void sortBySigma(List<adjEntry>& adjList, const Minisat::Model& model);
95  void embedFromModel(const Minisat::Model& model, adjEntry& externalToItsRight);
96  bool OE(bool embed, adjEntry& externalToItsRight, NodeArray<int>* nodeOrder);
97  bool FPSS(NodeArray<int>* nodeOrder); // cannot embed
98  bool HL(bool embed, adjEntry& externalToItsRight, NodeArray<int>* nodeOrder);
99  void writeNodeOrder(const Minisat::Model& model, NodeArray<int>* nodeOrder);
100 };
101 
102 }
HashArray.h
Declaration and implementation of HashArray class.
ogdf
The namespace for all OGDF objects.
Definition: AugmentationModule.h:36
BoyerMyrvold.h
Declaration of the wrapper class of the Boyer-Myrvold planarity test.
Minisat.h
Declaration of class Minisat.
Graph.h
Includes declaration of graph class.
ogdf::UpSAT::embedUpwardPlanar
bool embedUpwardPlanar(adjEntry &externalToItsRight, NodeArray< int > *nodeOrder=nullptr)
ogdf::UpSAT::ruleTauTransitive
void ruleTauTransitive()
ogdf::UpSAT::HL
bool HL(bool embed, adjEntry &externalToItsRight, NodeArray< int > *nodeOrder)
ogdf::UpSAT::m_G
Graph & m_G
Definition: UpSAT.h:60
Minisat::Formula
The Formula class.
Definition: Minisat.h:213
ogdf::UpSAT::computeDominatingEdges
void computeDominatingEdges()
ogdf::UpSAT::sigma
std::vector< std::vector< int > > sigma
Definition: UpSAT.h:71
ogdf::GraphCopy
Copies of graphs supporting edge splitting.
Definition: GraphCopy.h:384
ogdf::UpSAT::M
EdgeArray< int > M
Definition: UpSAT.h:66
ogdf::UpSAT::sortBySigma
void sortBySigma(List< adjEntry > &adjList, const Minisat::Model &model)
ogdf::UpSAT::numberOfClauses
long long numberOfClauses
Definition: UpSAT.h:63
ogdf::UpSAT::m_F
Minisat::Formula m_F
Definition: UpSAT.h:74
ogdf::UpSAT::FPSS
bool FPSS(NodeArray< int > *nodeOrder)
ogdf::UpSAT::embedFromModel
void embedFromModel(const Minisat::Model &model, adjEntry &externalToItsRight)
ogdf::UpSAT::ruleSigmaTransitive
void ruleSigmaTransitive()
ogdf::UpSAT::ruleUpward
void ruleUpward()
ogdf::UpSAT::tau
std::vector< std::vector< int > > tau
Definition: UpSAT.h:70
ogdf::AdjElement
Class for adjacency list elements.
Definition: Graph_d.h:135
Minisat::Model
Represents a simple class for model storage.
Definition: Minisat.h:150
ogdf::UpSAT::numberOfVariables
int numberOfVariables
Definition: UpSAT.h:62
ogdf::UpSAT::reset
void reset()
ogdf::UpSAT::getNumberOfClauses
long long getNumberOfClauses()
ogdf::UpSAT::ruleFixed
void ruleFixed(const Minisat::Model &model)
ogdf::List
Doubly linked lists (maintaining the length of the list).
Definition: List.h:42
ogdf::internal::GraphRegisteredArray
RegisteredArray for nodes, edges and adjEntries of a graph.
Definition: Graph_d.h:651
ogdf::Graph
Data type for general directed graphs (adjacency list representation).
Definition: Graph_d.h:862
ogdf::UpSAT
Definition: UpSAT.h:49
ogdf::UpSAT::computeSigmaVariables
void computeSigmaVariables()
ogdf::UpSAT::testUpwardPlanarity
bool testUpwardPlanarity(NodeArray< int > *nodeOrder=nullptr)
ogdf::UpSAT::getNumberOfVariables
int getNumberOfVariables()
ogdf::UpSAT::computeTauVariables
void computeTauVariables()
ogdf::UpSAT::ruleTutte
void ruleTutte()
ogdf::UpSAT::UpSAT
UpSAT(Graph &G)
ogdf::UpSAT::writeNodeOrder
void writeNodeOrder(const Minisat::Model &model, NodeArray< int > *nodeOrder)
ogdf::UpSAT::OE
bool OE(bool embed, adjEntry &externalToItsRight, NodeArray< int > *nodeOrder)
ogdf::UpSAT::computeMuVariables
void computeMuVariables()
List.h
Declaration of doubly linked lists and iterators.
ogdf::UpSAT::rulePlanarity
void rulePlanarity()
Graph_d.h
Pure declaration header, find template implementation in Graph.h.
ogdf::UpSAT::N
NodeArray< int > N
Definition: UpSAT.h:65
simple_graph_alg.h
Declaration of simple graph algorithms.
ogdf::UpSAT::mu
std::vector< std::vector< int > > mu
Definition: UpSAT.h:72
ogdf::UpSAT::D
EdgeArray< List< edge > > D
Definition: UpSAT.h:68
ogdf::internal::EdgeArrayBase2
RegisteredArray for edges of a graph, specialized for EdgeArray<edge>.
Definition: Graph_d.h:709
ogdf::UpSAT::feasibleOriginalEdges
bool feasibleOriginalEdges
Definition: UpSAT.h:56