Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

Loading...
Searching...
No Matches
Triple.h
Go to the documentation of this file.
1
33#pragma once
34
35#include <ogdf/basic/Graph.h>
36
37namespace ogdf {
38namespace steiner_tree {
39
43template<typename T>
44class Triple {
45public:
46 explicit Triple(const node s0 = nullptr, const node s1 = nullptr, const node s2 = nullptr,
47 const node z = nullptr, T cost = 0, double win = 0)
48 : m_s0(s0), m_s1(s1), m_s2(s2), m_z(z), m_cost(cost), m_win(win) { }
49
50 node s0() const { return m_s0; }
51
52 node s1() const { return m_s1; }
53
54 node s2() const { return m_s2; }
55
56 node z() const { return m_z; }
57
58 T cost() const { return m_cost; }
59
60 double win() const { return m_win; }
61
62 void s0(node u) { m_s0 = u; }
63
64 void s1(node u) { m_s1 = u; }
65
66 void s2(node u) { m_s2 = u; }
67
68 void z(node u) { m_z = u; }
69
70 void cost(T c) { m_cost = c; }
71
72 void win(double w) { m_win = w; }
73
74private:
78 double m_win;
79};
80
81}
82}
Includes declaration of graph class.
Class for the representation of nodes.
Definition Graph_d.h:177
This class represents a triple used by various contraction-based minimum Steiner tree approximations.
Definition Triple.h:44
node m_s2
terminal nodes
Definition Triple.h:75
double win() const
Definition Triple.h:60
double m_win
the win of the triple at some point of time (used as cache)
Definition Triple.h:78
T m_cost
edge costs of the triple in the original graph
Definition Triple.h:77
void win(double w)
Definition Triple.h:72
node m_z
center node of the triple
Definition Triple.h:76
Triple(const node s0=nullptr, const node s1=nullptr, const node s2=nullptr, const node z=nullptr, T cost=0, double win=0)
Definition Triple.h:46
The namespace for all OGDF objects.