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
34#include <ogdf/basic/Graph.h>
35
36namespace ogdf {
37class GraphCopy;
38
39template<typename T>
40class EdgeWeightedGraph : public Graph {
41public:
43
44 explicit EdgeWeightedGraph(GraphCopy& gC) { }
45
46 virtual ~EdgeWeightedGraph() { }
47
49 edge e = Graph::newEdge(v, w);
51 return e;
52 }
53
55 node u = Graph::newNode();
56 return u;
57 }
58
59 T weight(const edge e) const { return m_edgeWeight[e]; }
60
61 const EdgeArray<T>& edgeWeights() const { return m_edgeWeight; }
62
63 void setWeight(const edge e, T weight) { m_edgeWeight[e] = weight; }
64
65protected:
67};
68
69}
Includes declaration of graph class.
Class for the representation of edges.
Definition Graph_d.h:364
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:390
Data type for general directed graphs (adjacency list representation).
Definition Graph_d.h:866
node newNode(int index=-1)
Creates a new node and returns it.
Definition Graph_d.h:1061
edge newEdge(node v, node w, int index=-1)
Creates a new edge (v,w) and returns it.
Definition Graph_d.h:1080
Class for the representation of nodes.
Definition Graph_d.h:241
RegisteredArray for edges of a graph, specialized for EdgeArray<edge>.
Definition Graph_d.h:717
The namespace for all OGDF objects.