Open
Graph Drawing
Framework

 v. snapshot-2017-02-16
 

EdgeStandardRep.h
Go to the documentation of this file.
1 
39 #pragma once
40 
41 #include <ogdf/basic/Graph_d.h>
42 #include <ogdf/basic/NodeArray.h>
43 #include <ogdf/basic/EdgeArray.h>
47 
48 namespace ogdf {
49 
51 enum class EdgeStandardType {
55  clique = 0x0001,
60  star = 0x0002,
65  tree = 0x0003
66 };
67 
70 {
71 private:
72 
75 
78 
81 
84 
87 
90 
93 
96 
97 public:
98 
100  EdgeStandardRep();
101 
103  EdgeStandardRep(const Hypergraph &pH, EdgeStandardType pType);
104 
106  virtual ~EdgeStandardRep();
107 
109  void clear();
110 
112  const Hypergraph & hypergraph() const
113  {
114  return *m_hypergraph;
115  }
116 
118  const Graph & constGraph() const
119  {
120  return m_graphRep;
121  }
122 
125  return m_type;
126  }
127 
130  {
131  return m_nodeMap[v];
132  }
133 
136  {
137  return m_hypernodeMap[v];
138  }
139 
142  {
143  return m_edgeMap[e];
144  }
145 
148  {
149  return m_hyperedgeMap[e];
150  }
151 
153  const List<node> & dummyNodes() const
154  {
155  return m_dummyNodes;
156  }
157 
158 protected:
159 
161  virtual void hypernodeDeleted(hypernode v) override;
162 
164  virtual void hypernodeAdded(hypernode v) override;
165 
167  virtual void hyperedgeDeleted(hyperedge e) override;
168 
170  virtual void hyperedgeAdded(hyperedge e) override;
171 
173  virtual void cleared() override;
174 
175 private:
176 
177  void constructCliqueRep();
178 
179  void constructStarRep();
180 
181  void constructTreeRep();
182 
183  void hyperedgeToTree(hyperedge e, int degree);
184 
185  void hyperedgeToClique(hyperedge e);
186 
187  void cloneHypernodes();
188 
189 };
190 
191 } // end namespace ogdf
EdgeStandardType type() const
Returns the type of edge standard representation.
EdgeStandardType
Enumeration class of possible edge standard representations.
const List< node > & dummyNodes() const
Returns the list of dummy nodes.
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
HyperedgeArray< List< edge > > m_edgeMap
The map from representation hyperedge to edges.
Dynamic arrays indexed with edges.
Definition: EdgeArray.h:112
NodeArray< hypernode > m_hypernodeMap
The map from representation nodes to hypernodes.
for every hyperedge e = {v_1, ..., v_l} a single new dummy node v_e is introduced, moreover, v_e becomes the center of a new star connecting all hypernodes incident with e (ie. {v_1, v_e}, ..., {v_l, v_e} are added)
Abstract base class for observers on hypergraphs, that need to be informed about hypergraph changes (...
node nodeMap(hypernode v)
Returns the node associated with the hypernode.
Dynamic arrays indexed with nodes.
Definition: Graph_d.h:423
Declaration and implementation of EdgeArray class.
const Graph & constGraph() const
Returns a reference to the representation graph.
hyperedge hyperedgeMap(edge e)
Returns the hyperedge associated with the edge.
Graph m_graphRep
Edge standard representation of the hypergraph.
Doubly linked lists (maintaining the length of the list).
Definition: List.h:39
hypernode hypernodeMap(node v)
Returns the hypernode associated with the node (if any).
Class for the representation of hypernodes.
Definition: Hypergraph.h:265
no new dummy nodes are introduced, for every hyperedge e = (v_1, ..., v_l), we add a cliqie K_l conne...
Class for the representation of edges.
Definition: Graph_d.h:291
Declaration and a partial implementation of a Hypergraph class partly based on the original classes f...
Class for the representation of nodes.
Definition: Graph_d.h:167
Declaration and implementation of NodeArray class.
Pure declaration header, find template implementation in Graph.h.
Declaration and implementation of hyperraph array classes based on Node/EdgeArray classes written by ...
const List< edge > & edgeMap(hyperedge e)
Returns the list of edges associated with the hyperedge.
HypernodeArray< node > m_nodeMap
The map from representation hypernodes to nodes.
for every hyperedge e a minimal subcubic tree connecting all hypernodes incident with e together is a...
Class for the representation of hyperedges.
Definition: Hypergraph.h:156
The namespace for all OGDF objects.
EdgeArray< hyperedge > m_hyperedgeMap
The map from representation edge to hyperedges.
EdgeStandardType m_type
The type of edge standard representation.
List< node > m_dummyNodes
The list of all newly created nodes.
Edge standard representation of hypergraphs.
Dynamic arrays indexed with nodes.
Definition: Hypergraph.h:405
const Hypergraph * m_hypergraph
The reference to the original hypergraph.
Dynamic arrays indexed with hypernodes.
Definition: Hypergraph.h:404
const Hypergraph & hypergraph() const
Conversion to original hypergraph reference.