Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

ChunkConnection.h
Go to the documentation of this file.
1 
41 #pragma once
42 
43 #include <ogdf/basic/Array.h>
44 #include <ogdf/basic/ArrayBuffer.h>
48 
50 
51 namespace ogdf {
52 namespace cluster_planarity {
53 
55 #ifdef OGDF_DEBUG
56  //Mainly for debugging output purposes
57  friend class MaxCPlanarMaster;
58  friend class MaxCPlanarSub;
59  friend class CPlanarMaster;
60  friend class CPlanarSub;
61 #endif
62 public:
63  ChunkConnection(abacus::Master* master, const ArrayBuffer<node>& chunk,
64  const ArrayBuffer<node>& cochunk);
65 
66  virtual ~ChunkConnection();
67 
68  // Computes and returns the coefficient for the given variable
69  virtual double coeff(const abacus::Variable* v) const override {
70  const EdgeVar* ev = static_cast<const EdgeVar*>(v);
71  //Safe for both clustered planarity testing and maximum c-planar subgraph
72  return (ev->theEdgeType() != EdgeVar::EdgeType::Connect)
73  ? 0.0
74  : (double)coeff(ev->sourceNode(), ev->targetNode());
75  }
76 
77  inline int coeff(const NodePair& n) const override { return coeff(n.source, n.target); }
78 
79  int coeff(node v1, node v2) const;
80 
81  void printMe(std::ostream& out) const {
82  out << "[ChunkCon: (";
83  for (node v : m_chunk) {
84  Logger::slout() << v << ",";
85  }
86  out << "|";
87  for (node v : m_cochunk) {
88  Logger::slout() << v << ",";
89  }
90  out << ")]";
91  }
92 
93 private:
94  // The nodePairs corresponding to the constraint
97 };
98 
99 }
100 }
ogdf::ArrayBuffer
An array that keeps track of the number of inserted elements; also usable as an efficient stack.
Definition: Array.h:46
ogdf
The namespace for all OGDF objects.
Definition: AugmentationModule.h:36
ArrayBuffer.h
Declaration and implementation of ArrayBuffer class.
ogdf::cluster_planarity::EdgeVar::targetNode
node targetNode() const
Definition: EdgeVar.h:62
ogdf::cluster_planarity::MaxCPlanarSub
Definition: MaxCPlanarSub.h:47
ogdf::cluster_planarity::ChunkConnection
Definition: ChunkConnection.h:54
ogdf::cluster_planarity::ChunkConnection::m_chunk
Array< node > m_chunk
Definition: ChunkConnection.h:95
constraint.h
constraint.
ogdf::NodePair
Definition: Graph_d.h:2101
ogdf::cluster_planarity::ChunkConnection::ChunkConnection
ChunkConnection(abacus::Master *master, const ArrayBuffer< node > &chunk, const ArrayBuffer< node > &cochunk)
ogdf::NodePair::source
node source
Definition: Graph_d.h:2102
ogdf::cluster_planarity::MaxCPlanarMaster
Definition: MaxCPlanarMaster.h:48
ogdf::cluster_planarity::EdgeVar::EdgeType::Connect
@ Connect
EdgeVar.h
Declaration of the variable class for the Branch&Cut algorithm for the Maximum C-Planar SubGraph prob...
ogdf::Array< node >
ogdf::NodePair::target
node target
Definition: Graph_d.h:2103
abacus::Variable
Forms the virtual base class for all possible variables given in pool format.
Definition: variable.h:59
ogdf::cluster_planarity::BaseConstraint
Basic constraint type.
Definition: basics.h:60
ogdf::cluster_planarity::EdgeVar::sourceNode
node sourceNode() const
Definition: EdgeVar.h:60
ogdf::cluster_planarity::ChunkConnection::printMe
void printMe(std::ostream &out) const
Definition: ChunkConnection.h:81
Array.h
Declaration and implementation of Array class and Array algorithms.
ogdf::cluster_planarity::ChunkConnection::coeff
int coeff(const NodePair &n) const override
Definition: ChunkConnection.h:77
ogdf::cluster_planarity::ChunkConnection::CPlanarMaster
friend class CPlanarMaster
Definition: ChunkConnection.h:59
ogdf::cluster_planarity::EdgeVar::theEdgeType
EdgeType theEdgeType() const
Definition: EdgeVar.h:64
ClusterGraph.h
Derived class of GraphObserver providing additional functionality to handle clustered graphs.
basics.h
Declaration of the master class for the Branch&Cut algorithm for the Maximum C-Planar SubGraph proble...
ogdf::cluster_planarity::ChunkConnection::CPlanarSub
friend class CPlanarSub
Definition: ChunkConnection.h:60
ogdf::cluster_planarity::ChunkConnection::~ChunkConnection
virtual ~ChunkConnection()
ogdf::NodeElement
Class for the representation of nodes.
Definition: Graph_d.h:233
ogdf::cluster_planarity::EdgeVar
Definition: EdgeVar.h:44
ogdf::cluster_planarity::ChunkConnection::m_cochunk
Array< node > m_cochunk
Definition: ChunkConnection.h:96
ogdf::Logger::slout
static std::ostream & slout(Level level=Level::Default)
stream for logging-output (global)
Definition: Logger.h:191
abacus::Master
The master of the optimization.
Definition: master.h:69
ogdf::cluster_planarity::ChunkConnection::coeff
virtual double coeff(const abacus::Variable *v) const override
Returns the coefficient of the variable v in the constraint.
Definition: ChunkConnection.h:69