Open
Graph Drawing
Framework

 v. snapshot-2017-02-16
 

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  //FLAGS
55  //copy of the input graph
57  //number of clauses and variables
59  long long numberOfClauses;
60  //Indices of the nodes and edges of m_G
63  //Dominating edges-pairs
65  //Variables of the formulation(s)
66  std::vector< std::vector<int> > tau;
67  std::vector< std::vector<int> > sigma;
68  std::vector< std::vector<int> > mu;
69  //Formula
71 public:
72  bool testUpwardPlanarity(NodeArray<int> *nodeOrder = nullptr);
73  bool embedUpwardPlanar(adjEntry& externalToItsRight,NodeArray<int> *nodeOrder = nullptr);
74  long long getNumberOfClauses();
76  void reset();
77 private:
79  void computeTauVariables();
80  void computeSigmaVariables();
81  void computeMuVariables();
82  void ruleTauTransitive();
83  void ruleSigmaTransitive();
84  void ruleUpward();
85  void rulePlanarity();
86  void ruleTutte();
87  void ruleFixed(const Minisat::Model &model);
88  void sortBySigma(List<adjEntry> &adjList, const Minisat::Model &model);
89  void embedFromModel(const Minisat::Model &model, adjEntry& externalToItsRight);
90  bool OE(bool embed, adjEntry& externalToItsRight, NodeArray<int> *nodeOrder);
91  bool FPSS(NodeArray<int> *nodeOrder); // cannot embed
92  bool HL(bool embed, adjEntry& externalToItsRight, NodeArray<int> *nodeOrder);
93  void writeNodeOrder(const Minisat::Model &model, NodeArray<int> *nodeOrder);
94 };
95 
96 } // end namespace ogdf
void computeMuVariables()
NodeArray< int > N
Definition: UpSAT.h:61
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:472
void computeDominatingEdges()
void computeSigmaVariables()
std::vector< std::vector< int > > tau
Definition: UpSAT.h:66
std::vector< std::vector< int > > mu
Definition: UpSAT.h:68
void ruleFixed(const Minisat::Model &model)
bool FPSS(NodeArray< int > *nodeOrder)
bool feasibleOriginalEdges
Definition: UpSAT.h:54
void ruleSigmaTransitive()
void ruleUpward()
void ruleTauTransitive()
int getNumberOfVariables()
void reset()
void ruleTutte()
std::vector< std::vector< int > > sigma
Definition: UpSAT.h:67
void embedFromModel(const Minisat::Model &model, adjEntry &externalToItsRight)
long long getNumberOfClauses()
long long numberOfClauses
Definition: UpSAT.h:59
void computeTauVariables()
Doubly linked lists (maintaining the length of the list).
Definition: List.h:39
bool OE(bool embed, adjEntry &externalToItsRight, NodeArray< int > *nodeOrder)
Copies of graphs supporting edge splitting.
Definition: GraphCopy.h:250
void sortBySigma(List< adjEntry > &adjList, const Minisat::Model &model)
EdgeArray< int > M
Definition: UpSAT.h:62
The Formula class.
Definition: Minisat.h:233
Graph & m_G
Definition: UpSAT.h:56
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:64
The namespace for all OGDF objects.
UpSAT(Graph &G)
int numberOfVariables
Definition: UpSAT.h:58
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:78
Minisat::Formula m_F
Definition: UpSAT.h:70
Declaration of doubly linked lists and iterators.