Open
Graph Drawing
Framework

 v. 2020.02 (Catalpa)
 

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/List.h>
40 #include <ogdf/basic/HashArray.h>
42 #include <ogdf/external/Minisat.h>
43 #include <vector>
44 
45 namespace ogdf {
46 
47 class UpSAT {
48 public:
49  //constructor
50  explicit UpSAT(Graph &G);
52 private:
53  class Comp;
54  //FLAGS
56  //copy of the input graph
58  //number of clauses and variables
60  long long numberOfClauses;
61  //Indices of the nodes and edges of m_G
64  //Dominating edges-pairs
66  //Variables of the formulation(s)
67  std::vector< std::vector<int> > tau;
68  std::vector< std::vector<int> > sigma;
69  std::vector< std::vector<int> > mu;
70  //Formula
72 public:
73  bool testUpwardPlanarity(NodeArray<int> *nodeOrder = nullptr);
74  bool embedUpwardPlanar(adjEntry& externalToItsRight,NodeArray<int> *nodeOrder = nullptr);
75  long long getNumberOfClauses();
77  void reset();
78 private:
80  void computeTauVariables();
81  void computeSigmaVariables();
82  void computeMuVariables();
83  void ruleTauTransitive();
84  void ruleSigmaTransitive();
85  void ruleUpward();
86  void rulePlanarity();
87  void ruleTutte();
88  void ruleFixed(const Minisat::Model &model);
89  void sortBySigma(List<adjEntry> &adjList, const Minisat::Model &model);
90  void embedFromModel(const Minisat::Model &model, adjEntry& externalToItsRight);
91  bool OE(bool embed, adjEntry& externalToItsRight, NodeArray<int> *nodeOrder);
92  bool FPSS(NodeArray<int> *nodeOrder); // cannot embed
93  bool HL(bool embed, adjEntry& externalToItsRight, NodeArray<int> *nodeOrder);
94  void writeNodeOrder(const Minisat::Model &model, NodeArray<int> *nodeOrder);
95 };
96 
97 }
void computeMuVariables()
NodeArray< int > N
Definition: UpSAT.h:62
Declaration of class Minisat.
Declaration and implementation of HashArray class.
void writeNodeOrder(const Minisat::Model &model, NodeArray< int > *nodeOrder)
bool embedUpwardPlanar(adjEntry &externalToItsRight, NodeArray< int > *nodeOrder=nullptr)
Data type for general directed graphs (adjacency list representation).
Definition: Graph_d.h:492
void computeDominatingEdges()
void computeSigmaVariables()
std::vector< std::vector< int > > tau
Definition: UpSAT.h:67
std::vector< std::vector< int > > mu
Definition: UpSAT.h:69
void ruleFixed(const Minisat::Model &model)
bool FPSS(NodeArray< int > *nodeOrder)
bool feasibleOriginalEdges
Definition: UpSAT.h:53
void ruleSigmaTransitive()
void ruleUpward()
void ruleTauTransitive()
int getNumberOfVariables()
void reset()
void ruleTutte()
std::vector< std::vector< int > > sigma
Definition: UpSAT.h:68
void embedFromModel(const Minisat::Model &model, adjEntry &externalToItsRight)
long long getNumberOfClauses()
long long numberOfClauses
Definition: UpSAT.h:60
void computeTauVariables()
Doubly linked lists (maintaining the length of the list).
Definition: List.h:40
bool OE(bool embed, adjEntry &externalToItsRight, NodeArray< int > *nodeOrder)
Copies of graphs supporting edge splitting.
Definition: GraphCopy.h:249
void sortBySigma(List< adjEntry > &adjList, const Minisat::Model &model)
EdgeArray< int > M
Definition: UpSAT.h:63
The Formula class.
Definition: Minisat.h:233
Graph & m_G
Definition: UpSAT.h:57
void rulePlanarity()
Pure declaration header, find template implementation in Graph.h.
Includes declaration of graph class.
Declaration of the wrapper class of the Boyer-Myrvold planarity test.
bool testUpwardPlanarity(NodeArray< int > *nodeOrder=nullptr)
Declaration of simple graph algorithms.
EdgeArray< List< edge > > D
Definition: UpSAT.h:65
The namespace for all OGDF objects.
UpSAT(Graph &G)
int numberOfVariables
Definition: UpSAT.h:59
bool HL(bool embed, adjEntry &externalToItsRight, NodeArray< int > *nodeOrder)
Represents a simple class for model storage.
Definition: Minisat.h:160
Class for adjacency list elements.
Definition: Graph_d.h:79
Minisat::Formula m_F
Definition: UpSAT.h:71
Declaration of doubly linked lists and iterators.