Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

EdgeStandardRep.h
Go to the documentation of this file.
1 
39 #pragma once
40 
41 #include <ogdf/basic/Graph.h>
42 #include <ogdf/basic/List.h>
43 #include <ogdf/basic/basic.h>
46 
47 namespace ogdf {
48 
50 enum class EdgeStandardType {
54  clique = 0x0001,
59  star = 0x0002,
64  tree = 0x0003
65 };
66 
69 private:
72 
75 
78 
81 
84 
87 
90 
93 
94 public:
97 
100 
102  virtual ~EdgeStandardRep();
103 
105  void clear();
106 
108  const Hypergraph& hypergraph() const { return *m_hypergraph; }
109 
111  const Graph& constGraph() const { return m_graphRep; }
112 
114  EdgeStandardType type() const { return m_type; }
115 
117  node nodeMap(hypernode v) { return m_nodeMap[v]; }
118 
120  hypernode hypernodeMap(node v) { return m_hypernodeMap[v]; }
121 
123  const List<edge>& edgeMap(hyperedge e) { return m_edgeMap[e]; }
124 
126  hyperedge hyperedgeMap(edge e) { return m_hyperedgeMap[e]; }
127 
129  const List<node>& dummyNodes() const { return m_dummyNodes; }
130 
131 protected:
133  virtual void hypernodeDeleted(hypernode v) override;
134 
136  virtual void hypernodeAdded(hypernode v) override;
137 
139  virtual void hyperedgeDeleted(hyperedge e) override;
140 
142  virtual void hyperedgeAdded(hyperedge e) override;
143 
145  virtual void cleared() override;
146 
147 private:
148  void constructCliqueRep();
149 
150  void constructStarRep();
151 
152  void constructTreeRep();
153 
154  void hyperedgeToTree(hyperedge e, int degree);
155 
156  void hyperedgeToClique(hyperedge e);
157 
158  void cloneHypernodes();
159 };
160 
161 }
ogdf::EdgeStandardRep::m_dummyNodes
List< node > m_dummyNodes
The list of all newly created nodes.
Definition: EdgeStandardRep.h:92
ogdf
The namespace for all OGDF objects.
Definition: multilevelmixer.cpp:39
Graph.h
Includes declaration of graph class.
ogdf::EdgeStandardRep::dummyNodes
const List< node > & dummyNodes() const
Returns the list of dummy nodes.
Definition: EdgeStandardRep.h:129
ogdf::EdgeStandardRep::constGraph
const Graph & constGraph() const
Returns a reference to the representation graph.
Definition: EdgeStandardRep.h:111
ogdf::EdgeStandardRep::m_hypernodeMap
NodeArray< hypernode > m_hypernodeMap
The map from representation nodes to hypernodes.
Definition: EdgeStandardRep.h:80
ogdf::EdgeStandardRep::m_nodeMap
HypernodeArray< node > m_nodeMap
The map from representation hypernodes to nodes.
Definition: EdgeStandardRep.h:83
ogdf::HypergraphRegisteredArray
RegisteredArray for nodes and edges of a hypergraph.
Definition: Hypergraph.h:381
ogdf::EdgeStandardRep::m_edgeMap
HyperedgeArray< List< edge > > m_edgeMap
The map from representation hyperedge to edges.
Definition: EdgeStandardRep.h:89
ogdf::EdgeStandardRep::hyperedgeMap
hyperedge hyperedgeMap(edge e)
Returns the hyperedge associated with the edge.
Definition: EdgeStandardRep.h:126
ogdf::EdgeStandardRep::hypernodeMap
hypernode hypernodeMap(node v)
Returns the hypernode associated with the node (if any).
Definition: EdgeStandardRep.h:120
ogdf::EdgeStandardType
EdgeStandardType
Enumeration class of possible edge standard representations.
Definition: EdgeStandardRep.h:50
ogdf::HyperedgeElement
Class for the representation of hyperedges.
Definition: Hypergraph.h:146
ogdf::EdgeStandardRep::m_graphRep
Graph m_graphRep
Edge standard representation of the hypergraph.
Definition: EdgeStandardRep.h:77
Hypergraph.h
Declaration and a partial implementation of a Hypergraph class partly based on the original classes f...
ogdf::EdgeStandardRep::hypergraph
const Hypergraph & hypergraph() const
Conversion to original hypergraph reference.
Definition: EdgeStandardRep.h:108
ogdf::EdgeStandardRep::m_hyperedgeMap
EdgeArray< hyperedge > m_hyperedgeMap
The map from representation edge to hyperedges.
Definition: EdgeStandardRep.h:86
HypergraphObserver.h
Abstract base class for observers on hypergraphs, that need to be informed about hypergraph changes (...
ogdf::EdgeStandardRep
Edge standard representation of hypergraphs.
Definition: EdgeStandardRep.h:68
ogdf::EdgeStandardType::star
@ star
for every hyperedge e = {v_1, ..., v_l} a single new dummy node v_e is introduced,...
ogdf::EdgeStandardRep::nodeMap
node nodeMap(hypernode v)
Returns the node associated with the hypernode.
Definition: EdgeStandardRep.h:117
ogdf::List
Doubly linked lists (maintaining the length of the list).
Definition: DfsMakeBiconnected.h:40
ogdf::internal::GraphRegisteredArray
RegisteredArray for nodes, edges and adjEntries of a graph.
Definition: Graph_d.h:658
ogdf::EdgeStandardRep::type
EdgeStandardType type() const
Returns the type of edge standard representation.
Definition: EdgeStandardRep.h:114
ogdf::EdgeStandardType::clique
@ clique
no new dummy nodes are introduced, for every hyperedge e = (v_1, ..., v_l), we add a cliqie K_l conne...
ogdf::Graph
Data type for general directed graphs (adjacency list representation).
Definition: Graph_d.h:869
ogdf::EdgeStandardType::tree
@ tree
for every hyperedge e a minimal subcubic tree connecting all hypernodes incident with e together is a...
ogdf::EdgeStandardRep::edgeMap
const List< edge > & edgeMap(hyperedge e)
Returns the list of edges associated with the hyperedge.
Definition: EdgeStandardRep.h:123
basic.h
Basic declarations, included by all source files.
OGDF_EXPORT
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF DLL.
Definition: config.h:101
ogdf::EdgeElement
Class for the representation of edges.
Definition: Graph_d.h:363
List.h
Declaration of doubly linked lists and iterators.
ogdf::EdgeStandardRep::m_hypergraph
const Hypergraph * m_hypergraph
The reference to the original hypergraph.
Definition: EdgeStandardRep.h:74
ogdf::EdgeStandardRep::m_type
EdgeStandardType m_type
The type of edge standard representation.
Definition: EdgeStandardRep.h:71
ogdf::HypergraphObserver
Definition: HypergraphObserver.h:49
ogdf::NodeElement
Class for the representation of nodes.
Definition: Graph_d.h:240
ogdf::Hypergraph
Definition: Hypergraph.h:409
ogdf::internal::EdgeArrayBase2
RegisteredArray for edges of a graph, specialized for EdgeArray<edge>.
Definition: Graph_d.h:716
ogdf::HypernodeElement
Class for the representation of hypernodes.
Definition: Hypergraph.h:226