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 
38 #include <ogdf/external/Minisat.h>
39 
40 #include <vector>
41 
42 namespace ogdf {
43 class GraphCopy;
44 template<class E>
45 class List;
46 
47 class UpSAT {
48 public:
49  //constructor
50  explicit UpSAT(Graph& G);
52 
53 private:
54  class Comp;
55 
56  //FLAGS
58  //copy of the input graph
60  //number of clauses and variables
62  long long numberOfClauses;
63  //Indices of the nodes and edges of m_G
66  //Dominating edges-pairs
68  //Variables of the formulation(s)
69  std::vector<std::vector<int>> tau;
70  std::vector<std::vector<int>> sigma;
71  std::vector<std::vector<int>> mu;
72  //Formula
74 
75 public:
76  bool testUpwardPlanarity(NodeArray<int>* nodeOrder = nullptr);
77  bool embedUpwardPlanar(adjEntry& externalToItsRight, NodeArray<int>* nodeOrder = nullptr);
78  long long getNumberOfClauses();
80  void reset();
81 
82 private:
84  void computeTauVariables();
85  void computeSigmaVariables();
86  void computeMuVariables();
87  void ruleTauTransitive();
88  void ruleSigmaTransitive();
89  void ruleUpward();
90  void rulePlanarity();
91  void ruleTutte();
92  void ruleFixed(const Minisat::Model& model);
93  void sortBySigma(List<adjEntry>& adjList, const Minisat::Model& model);
94  void embedFromModel(const Minisat::Model& model, adjEntry& externalToItsRight);
95  bool OE(bool embed, adjEntry& externalToItsRight, NodeArray<int>* nodeOrder);
96  bool FPSS(NodeArray<int>* nodeOrder); // cannot embed
97  bool HL(bool embed, adjEntry& externalToItsRight, NodeArray<int>* nodeOrder);
98  void writeNodeOrder(const Minisat::Model& model, NodeArray<int>* nodeOrder);
99 };
100 
101 }
ogdf
The namespace for all OGDF objects.
Definition: multilevelmixer.cpp:39
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:59
Minisat::Formula
The Formula class.
Definition: Minisat.h:218
ogdf::UpSAT::computeDominatingEdges
void computeDominatingEdges()
ogdf::UpSAT::sigma
std::vector< std::vector< int > > sigma
Definition: UpSAT.h:70
ogdf::GraphCopy
Copies of graphs supporting edge splitting.
Definition: GraphCopy.h:391
ogdf::UpSAT::M
EdgeArray< int > M
Definition: UpSAT.h:65
ogdf::UpSAT::sortBySigma
void sortBySigma(List< adjEntry > &adjList, const Minisat::Model &model)
ogdf::UpSAT::numberOfClauses
long long numberOfClauses
Definition: UpSAT.h:62
ogdf::UpSAT::m_F
Minisat::Formula m_F
Definition: UpSAT.h:73
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:69
ogdf::AdjElement
Class for adjacency list elements.
Definition: Graph_d.h:142
Minisat::Model
Represents a simple class for model storage.
Definition: Minisat.h:155
ogdf::UpSAT::numberOfVariables
int numberOfVariables
Definition: UpSAT.h:61
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: DfsMakeBiconnected.h:40
ogdf::internal::GraphRegisteredArray
RegisteredArray for nodes, edges and adjEntries of a graph.
Definition: Graph_d.h:658
ogdf::Graph
Data type for general directed graphs (adjacency list representation).
Definition: Graph_d.h:869
ogdf::UpSAT
Definition: UpSAT.h:47
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()
ogdf::UpSAT::rulePlanarity
void rulePlanarity()
ogdf::UpSAT::N
NodeArray< int > N
Definition: UpSAT.h:64
ogdf::UpSAT::mu
std::vector< std::vector< int > > mu
Definition: UpSAT.h:71
ogdf::UpSAT::D
EdgeArray< List< edge > > D
Definition: UpSAT.h:67
ogdf::internal::EdgeArrayBase2
RegisteredArray for edges of a graph, specialized for EdgeArray<edge>.
Definition: Graph_d.h:716
ogdf::UpSAT::feasibleOriginalEdges
bool feasibleOriginalEdges
Definition: UpSAT.h:54