Open
Graph Drawing
Framework

 v. snapshot-2017-02-16
 

PlanarSPQRTree.h
Go to the documentation of this file.
1 
32 #pragma once
33 
35 
36 namespace ogdf {
37 
39 
52 class OGDF_EXPORT PlanarSPQRTree : public virtual SPQRTree
53 {
54 public:
55  //
56  // a) Access operations
57  //
58 
60  double numberOfEmbeddings() const {
61  return numberOfEmbeddings(rootNode());
62  }
63 
65 
68  double numberOfEmbeddings(node v) const;
69 
71 
75  long long numberOfNodeEmbeddings(node vT);
76 
77  //
78  // b) Update operations
79  //
80 
82 
86  void reverse(node vT);
87 
89 
93  void swap(node vT, edge e1, edge e2);
94 
96 
100  void swap(node vT, adjEntry adj1, adjEntry adj2);
101 
103 
106  void embed(Graph &G);
107 
109  void randomEmbed();
110 
112 
115  void randomEmbed(Graph &G) {
116  randomEmbed();
117  embed(G);
118  }
119 
121 
124  void firstEmbedding(Graph &G);
125 
127 
132  bool nextEmbedding(Graph &G);
133 
135 
139  void embed(node &vT, long long x);
140 
141 
142 protected:
144  void init(bool isEmbedded);
145  void adoptEmbedding();
146  void setPosInEmbedding(
147  NodeArray<SListPure<adjEntry> > &adjEdges,
148  NodeArray<node> &currentCopy,
149  NodeArray<adjEntry> &lastAdj,
150  SListPure<node> &current,
151  const Skeleton &S,
152  adjEntry adj);
153 
154  // Embeda original graph according to embeddings of skeletons.
155  void expandVirtualEmbed(node vT,
156  adjEntry adjVirt,
157  SListPure<adjEntry> &adjEdges);
158  void createInnerVerticesEmbed(Graph &G, node vT);
159 
160  // Enumeration of all embeddings
161  void firstEmbedding(node &vT);
162  void reverse(node &nP,
163  adjEntry &first,
164  adjEntry &last);
165  bool nextEmbedding(node &vT);
166  bool nextEmbedding(ListIterator<node> it);
167 
169 
170 }; // class PlanarSPQRTree
171 
172 
173 } // end namespace ogdf
void randomEmbed(Graph &G)
Embeds all skeleton graphs randomly and embeds G according to the embeddings of the skeletons...
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
Singly linked lists.
Definition: SList.h:38
Skeleton graphs of nodes in an SPQR-tree.
Definition: Skeleton.h:61
Dynamic arrays indexed with nodes.
Definition: Graph_d.h:423
Class for the representation of edges.
Definition: Graph_d.h:291
double numberOfEmbeddings() const
Returns the number of possible embeddings of G.
Class for the representation of nodes.
Definition: Graph_d.h:167
Declaration of class SPQRTree.
Encapsulates a pointer to a list element.
Definition: List.h:41
SPQR-trees of planar graphs.
Linear-time implementation of static SPQR-trees.
Definition: SPQRTree.h:71
The namespace for all OGDF objects.
Class for adjacency list elements.
Definition: Graph_d.h:78