Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

Loading...
Searching...
No Matches
GraphReduction.h
Go to the documentation of this file.
1
33#pragma once
34
38#include <ogdf/basic/SList.h>
39
40namespace ogdf {
41
42
44
50protected:
51 const Graph* m_pGraph; // original graph
52 NodeArray<node> m_vOrig; // corresponding node in original graph
53 EdgeArray<List<edge>> m_eOrig; // corresponding edge in original graph
54
55 NodeArray<node> m_vReduction; // corresponding node in graph copy
56 EdgeArray<edge> m_eReduction; // corresponding chain of edges in graph copy
57
58 GraphReduction() : m_pGraph(nullptr) { }
59
60public:
61 // construction
62 explicit GraphReduction(const Graph& G);
63
64 virtual ~GraphReduction() { }
65
66 // returns original graph
67 const Graph& original() const { return *m_pGraph; }
68
69 // returns original node
70 node original(node v) const { return m_vOrig[v]; }
71
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
78 // returns reduction of edge e
79 edge reduction(edge e) const { return m_eReduction[e]; }
80};
81
82}
Declaration of CombinatorialEmbedding and face.
Declaration and implementation of EdgeArray class.
Declaration and implementation of NodeArray class.
Declaration of singly linked lists and iterators.
Dynamic arrays indexed with edges.
Definition EdgeArray.h:125
Class for the representation of edges.
Definition Graph_d.h:300
Data type for general directed graphs (adjacency list representation).
Definition Graph_d.h:521
Creates a reduced graph by removing leaves, self-loops, and reducing chains.
const Graph & original() const
NodeArray< node > m_vOrig
const List< edge > & original(edge e) const
const Graph * m_pGraph
NodeArray< node > m_vReduction
GraphReduction(const Graph &G)
node reduction(node v) const
node original(node v) const
EdgeArray< edge > m_eReduction
EdgeArray< List< edge > > m_eOrig
edge reduction(edge e) const
Doubly linked lists (maintaining the length of the list).
Definition List.h:1435
Dynamic arrays indexed with nodes.
Definition NodeArray.h:125
Class for the representation of nodes.
Definition Graph_d.h:177
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF DLL.
Definition config.h:101
static MultilevelBuilder * getDoubleFactoredZeroAdjustedMerger()
The namespace for all OGDF objects.