Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

CutConstraint.h
Go to the documentation of this file.
1 
37 #pragma once
38 
39 #include <ogdf/basic/Graph.h>
40 #include <ogdf/basic/List.h>
43 
44 #include <ostream>
45 
46 namespace abacus {
47 class Master;
48 class Sub;
49 class Variable;
50 } // namespace abacus
51 
52 namespace ogdf {
53 namespace cluster_planarity {
54 
55 class CutConstraint : public BaseConstraint {
56 public:
58 
59  virtual ~CutConstraint();
60 
61  // Computes and returns the coefficient for the given variable
62  virtual double coeff(const abacus::Variable* v) const override {
63  const EdgeVar* ev = static_cast<const EdgeVar*>(v);
64  return static_cast<double>(coeff(ev->sourceNode(), ev->targetNode()));
65  }
66 
67  inline int coeff(const NodePair& n) const override { return coeff(n.source, n.target); }
68 
69  int coeff(node n1, node n2) const;
70 
71  void printMe(std::ostream& out) const {
72  out << "[CutCon: ";
73  for (const NodePair& p : m_cutEdges) {
74  out << p << ",";
75  }
76  out << "]";
77  }
78 
79 private:
80  // The list containing the node pairs corresponding to the cut edges
82 };
83 
84 }
85 }
ogdf
The namespace for all OGDF objects.
Definition: multilevelmixer.cpp:39
Graph.h
Includes declaration of graph class.
ogdf::cluster_planarity::EdgeVar::targetNode
node targetNode() const
Definition: EdgeVar.h:63
abacus::ConVar::sub
const Sub * sub() const
Returns a const pointer to the subproblem associated with the constraint/variable.
Definition: convar.h:199
ogdf::NodePair
Definition: Graph_d.h:2109
ogdf::cluster_planarity::CutConstraint::m_cutEdges
List< NodePair > m_cutEdges
Definition: CutConstraint.h:81
abacus
Definition: ILPClusterPlanarity.h:50
ogdf::NodePair::source
node source
Definition: Graph_d.h:2110
ogdf::cluster_planarity::CutConstraint::printMe
void printMe(std::ostream &out) const
Definition: CutConstraint.h:71
EdgeVar.h
Declaration of the variable class for the Branch&Cut algorithm for the Maximum C-Planar SubGraph prob...
ogdf::cluster_planarity::CutConstraint::CutConstraint
CutConstraint(abacus::Master *master, abacus::Sub *sub, List< NodePair > &edges)
ogdf::NodePair::target
node target
Definition: Graph_d.h:2111
abacus::Variable
Forms the virtual base class for all possible variables given in pool format.
Definition: variable.h:59
ogdf::List
Doubly linked lists (maintaining the length of the list).
Definition: DfsMakeBiconnected.h:40
ogdf::cluster_planarity::BaseConstraint
Basic constraint type.
Definition: basics.h:56
ogdf::cluster_planarity::EdgeVar::sourceNode
node sourceNode() const
Definition: EdgeVar.h:61
ogdf::cluster_planarity::CutConstraint::~CutConstraint
virtual ~CutConstraint()
ogdf::cluster_planarity::CutConstraint::coeff
int coeff(const NodePair &n) const override
Definition: CutConstraint.h:67
ogdf::AlgorithmFailureCode::Variable
@ Variable
abacus::Sub
The subproblem.
Definition: sub.h:68
basics.h
Declaration of the master class for the Branch&Cut algorithm for the Maximum C-Planar SubGraph proble...
List.h
Declaration of doubly linked lists and iterators.
ogdf::NodeElement
Class for the representation of nodes.
Definition: Graph_d.h:240
ogdf::cluster_planarity::CutConstraint
Definition: CutConstraint.h:55
ogdf::cluster_planarity::EdgeVar
Definition: EdgeVar.h:45
ogdf::cluster_planarity::CutConstraint::coeff
virtual double coeff(const abacus::Variable *v) const override
Returns the coefficient of the variable v in the constraint.
Definition: CutConstraint.h:62
abacus::Master
The master of the optimization.
Definition: master.h:69