Open
Graph Drawing
Framework

 v. snapshot-2017-02-16
 

GraphReduction.h
Go to the documentation of this file.
1 
33 #pragma once
34 
35 #include <ogdf/basic/NodeArray.h>
36 #include <ogdf/basic/EdgeArray.h>
37 #include <ogdf/basic/SList.h>
39 
40 
41 namespace ogdf {
42 
43 
45 
51 protected:
52 
53  const Graph *m_pGraph; // original graph
54  NodeArray<node> m_vOrig; // corresponding node in original graph
55  EdgeArray<List<edge> > m_eOrig; // corresponding edge in original graph
56 
57  NodeArray<node> m_vReduction; // corresponding node in graph copy
58  EdgeArray<edge> m_eReduction; // corresponding chain of edges in graph copy
59 
60  GraphReduction() : m_pGraph(nullptr) { }
61 
62 public:
63  // construction
64  explicit GraphReduction(const Graph& G);
65  virtual ~GraphReduction() { }
66 
67  // returns original graph
68  const Graph &original() const { return *m_pGraph; }
69 
70  // returns original node
71  node original(node v) const { return m_vOrig[v]; }
72  // returns original edges
73  const List<edge> &original(edge e) const { return m_eOrig[e]; }
74 
75  // returns reduction of node v (0 if none)
76  node reduction(node v) const { return m_vReduction[v]; }
77  // returns reduction of edge e
78  edge reduction(edge e) const { return m_eReduction[e]; }
79 
80 };
81 
82 
83 } // end namespace ogdf
Declaration of singly linked lists and iterators.
edge reduction(edge e) const
Data type for general directed graphs (adjacency list representation).
Definition: Graph_d.h:472
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF DLL.
Definition: config.h:99
node reduction(node v) const
Declaration of CombinatorialEmbedding and face.
Dynamic arrays indexed with edges.
Definition: EdgeArray.h:112
const List< edge > & original(edge e) const
NodeArray< node > m_vOrig
Dynamic arrays indexed with nodes.
Definition: Graph_d.h:423
Declaration and implementation of EdgeArray class.
Class for the representation of edges.
Definition: Graph_d.h:291
node original(node v) const
Class for the representation of nodes.
Definition: Graph_d.h:167
Declaration and implementation of NodeArray class.
EdgeArray< edge > m_eReduction
The namespace for all OGDF objects.
const Graph * m_pGraph
Creates a reduced graph by removing leaves, self-loops, and reducing chains.
EdgeArray< List< edge > > m_eOrig
NodeArray< node > m_vReduction
const Graph & original() const