Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

Loading...
Searching...
No Matches
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
46namespace abacus {
47class Master;
48class Sub;
49class Variable;
50} // namespace abacus
51
52namespace ogdf {
53namespace cluster_planarity {
54
56public:
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
79private:
80 // The list containing the node pairs corresponding to the cut edges
82};
83
84}
85}
Declaration of the variable class for the Branch&Cut algorithm for the Maximum C-Planar SubGraph prob...
Includes declaration of graph class.
Declaration of doubly linked lists and iterators.
Declaration of the master class for the Branch&Cut algorithm for the Maximum C-Planar SubGraph proble...
const Sub * sub() const
Returns a const pointer to the subproblem associated with the constraint/variable.
Definition convar.h:200
The master of the optimization.
Definition master.h:70
The subproblem.
Definition sub.h:69
Forms the virtual base class for all possible variables given in pool format.
Definition variable.h:60
Doubly linked lists (maintaining the length of the list).
Definition List.h:1451
Class for the representation of nodes.
Definition Graph_d.h:241
int coeff(const NodePair &n) const override
int coeff(node n1, node n2) const
void printMe(std::ostream &out) const
CutConstraint(abacus::Master *master, abacus::Sub *sub, List< NodePair > &edges)
virtual double coeff(const abacus::Variable *v) const override
Returns the coefficient of the variable v in the constraint.
The namespace for all OGDF objects.