Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

Loading...
Searching...
No Matches
EdgeWeightedGraph.h
Go to the documentation of this file.
1
32#pragma once
33
35
36namespace ogdf {
37
38template<typename T>
39class EdgeWeightedGraph : public Graph {
40public:
42
44
45 virtual ~EdgeWeightedGraph() { }
46
48 edge e = Graph::newEdge(v, w);
50 return e;
51 }
52
54 node u = Graph::newNode();
55 return u;
56 }
57
58 T weight(const edge e) const { return m_edgeWeight[e]; }
59
60 const EdgeArray<T>& edgeWeights() const { return m_edgeWeight; }
61
62 void setWeight(const edge e, T weight) { m_edgeWeight[e] = weight; }
63
64protected:
66};
67
68}
Declaration of graph copy classes.
Dynamic arrays indexed with edges.
Definition EdgeArray.h:125
Class for the representation of edges.
Definition Graph_d.h:300
T weight(const edge e) const
EdgeWeightedGraph(GraphCopy &gC)
edge newEdge(node v, node w, T weight)
const EdgeArray< T > & edgeWeights() const
void setWeight(const edge e, T weight)
Copies of graphs supporting edge splitting.
Definition GraphCopy.h:254
Data type for general directed graphs (adjacency list representation).
Definition Graph_d.h:521
edge newEdge(node v, node w)
Creates a new edge (v,w) and returns it.
node newNode()
Creates a new node and returns it.
Class for the representation of nodes.
Definition Graph_d.h:177
static MultilevelBuilder * getDoubleFactoredZeroAdjustedMerger()
The namespace for all OGDF objects.