Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

PlanarSPQRTree.h
Go to the documentation of this file.
1 
32 #pragma once
33 
34 #include <ogdf/basic/Graph.h>
35 #include <ogdf/basic/List.h>
36 #include <ogdf/basic/basic.h>
38 
39 namespace ogdf {
40 class Skeleton;
41 template<class E>
42 class SListPure;
43 
45 
58 class OGDF_EXPORT PlanarSPQRTree : public virtual SPQRTree {
59 public:
60  //
61  // a) Access operations
62  //
63 
65  double numberOfEmbeddings() const { return numberOfEmbeddings(rootNode()); }
66 
68 
71  double numberOfEmbeddings(node v) const;
72 
74 
78  long long numberOfNodeEmbeddings(node vT) const;
79 
80  //
81  // b) Update operations
82  //
83 
85 
89  void reverse(node vT);
90 
92 
96  void swap(node vT, edge e1, edge e2);
97 
99 
103  void swap(node vT, adjEntry adj1, adjEntry adj2);
104 
106 
109  void embed(Graph& G);
110 
112  void randomEmbed();
113 
115 
118  void randomEmbed(Graph& G) {
119  randomEmbed();
120  embed(G);
121  }
122 
124 
127  void firstEmbedding(Graph& G);
128 
130 
135  bool nextEmbedding(Graph& G);
136 
138 
142  void embed(node& vT, long long x);
143 
144 
145 protected:
147  void init(bool isEmbedded);
148  void adoptEmbedding();
149  void setPosInEmbedding(NodeArray<SListPure<adjEntry>>& adjEdges, NodeArray<node>& currentCopy,
150  NodeArray<adjEntry>& lastAdj, SListPure<node>& current, const Skeleton& S, adjEntry adj);
151 
152  // Embeda original graph according to embeddings of skeletons.
153  void expandVirtualEmbed(node vT, adjEntry adjVirt, SListPure<adjEntry>& adjEdges);
154  void createInnerVerticesEmbed(Graph& G, node vT);
155 
156  // Enumeration of all embeddings
157  void firstEmbedding(node& vT);
158  void reverse(node& nP, adjEntry& first, adjEntry& last);
159  bool nextEmbedding(node& vT);
160  bool nextEmbedding(ListIterator<node> it);
161 
163 };
164 
165 }
ogdf
The namespace for all OGDF objects.
Definition: multilevelmixer.cpp:39
Graph.h
Includes declaration of graph class.
SPQRTree.h
Declaration of class SPQRTree.
ogdf::SPQRTree
Linear-time implementation of static SPQR-trees.
Definition: SPQRTree.h:73
ogdf::PlanarSPQRTree::numberOfEmbeddings
double numberOfEmbeddings() const
Returns the number of possible embeddings of G.
Definition: PlanarSPQRTree.h:65
ogdf::AdjElement
Class for adjacency list elements.
Definition: Graph_d.h:142
ogdf::reverse
Reverse< T > reverse(T &container)
Provides iterators for container to make it easily iterable in reverse.
Definition: Reverse.h:74
ogdf::PlanarSPQRTree
SPQR-trees of planar graphs.
Definition: PlanarSPQRTree.h:58
ogdf::PlanarSPQRTree::m_finished
bool m_finished
Definition: PlanarSPQRTree.h:162
ogdf::SListPure
Singly linked lists.
Definition: SList.h:52
ogdf::internal::GraphRegisteredArray
RegisteredArray for nodes, edges and adjEntries of a graph.
Definition: Graph_d.h:658
ogdf::Graph
Data type for general directed graphs (adjacency list representation).
Definition: Graph_d.h:869
ogdf::PlanarSPQRTree::randomEmbed
void randomEmbed(Graph &G)
Embeds all skeleton graphs randomly and embeds G according to the embeddings of the skeletons.
Definition: PlanarSPQRTree.h:118
ogdf::graphics::init
void init()
Definition: graphics.h:450
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::Skeleton
Skeleton graphs of nodes in an SPQR-tree.
Definition: Skeleton.h:60
ogdf::ListIteratorBase
Encapsulates a pointer to a list element.
Definition: List.h:51
ogdf::NodeElement
Class for the representation of nodes.
Definition: Graph_d.h:240