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
35#include <ogdf/basic/Graph.h>
36#include <ogdf/basic/List.h>
37#include <ogdf/basic/basic.h>
38
39namespace ogdf {
40
41
43
49protected:
50 const Graph* m_pGraph; // original graph
51 NodeArray<node> m_vOrig; // corresponding node in original graph
52 EdgeArray<List<edge>> m_eOrig; // corresponding edge in original graph
53
54 NodeArray<node> m_vReduction; // corresponding node in graph copy
55 EdgeArray<edge> m_eReduction; // corresponding chain of edges in graph copy
56
57 GraphReduction() : m_pGraph(nullptr) { }
58
59public:
60 // construction
61 explicit GraphReduction(const Graph& G);
62
63 virtual ~GraphReduction() { }
64
65 // returns original graph
66 const Graph& original() const { return *m_pGraph; }
67
68 // returns original node
69 node original(node v) const { return m_vOrig[v]; }
70
71 // returns original edges
72 const List<edge>& original(edge e) const { return m_eOrig[e]; }
73
74 // returns reduction of node v (0 if none)
75 node reduction(node v) const { return m_vReduction[v]; }
76
77 // returns reduction of edge e
78 edge reduction(edge e) const { return m_eReduction[e]; }
79};
80
81}
Includes declaration of graph class.
Declaration of doubly linked lists and iterators.
Basic declarations, included by all source files.
Class for the representation of edges.
Definition Graph_d.h:364
Data type for general directed graphs (adjacency list representation).
Definition Graph_d.h:866
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:1451
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
RegisteredArray for nodes, edges and adjEntries of a graph.
Definition Graph_d.h:659
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF dynamic library (shared object / DLL),...
Definition config.h:117
The namespace for all OGDF objects.