55 template<
class LISTITERATOR>
73 template<
class LISTITERATOR>
81 nodeTableOrig2New.
init(G,
nullptr);
86 for (its = start; its.valid(); its++)
91 nodeTableOrig2New[w] = subGraph.
newNode();
96 if (nodeTableOrig2New[e->
source()] && nodeTableOrig2New[e->
target()] && !mark[e])
118 template<
class LISTITERATOR>
127 nodeTableOrig2New.
init(G,
nullptr);
128 edgeTableOrig2New.
init(G,
nullptr);
133 for (its = start; its.valid(); its++)
138 nodeTableOrig2New[w] = subGraph.
newNode();
143 if (nodeTableOrig2New[e->
source()] &&
144 nodeTableOrig2New[e->
target()] &&
147 edgeTableOrig2New[e] =
149 nodeTableOrig2New[e->
source()],
150 nodeTableOrig2New[e->
target()]);
169 template<
class NODELISTITERATOR,
class EDGELIST>
172 NODELISTITERATOR itBegin = it;
175 for (;it.valid();it++)
178 for (;it.valid();it++)
290 pred.
init(G,
nullptr);
292 while (!pq.
empty()) {
297 const node w = adj->twinNode();
298 const edge e = adj->theEdge();
299 if (pred[w] ==
nullptr && w != s) {
331 isInTree.
init(G,
false);
336 isInTree[pred[v]] =
true;
337 treeWeight += weight[pred[v]];
363 sortEdges.quicksort();
369 setID[v] = uf.makeSet();
372 for (
auto prioEdge : sortEdges) {
373 const edge e = prioEdge.item();
374 const int v = setID[e->
source()];
375 const int w = setID[e->
target()];
376 if (uf.find(v) != uf.find(w)) {
377 uf.link(uf.find(v), uf.find(w));
421 copy.newEdge(copy.copy(s), copy.copy(t));
node target() const
Returns the target node of the edge.
void pop()
Removes the topmost element from the queue.
The parameterized class Array implements dynamic arrays of type E.
Derived class of GraphObserver providing additional functionality to handle clustered graphs...
edge theEdge() const
Returns the edge associated with this adjacency entry.
Wrapper class used for preprocessing and valid invocation of the planarity test.
virtual void clear()
Removes all nodes and all edges from the graph.
void init()
Reinitializes the array. Associates the array with no graph.
Data type for general directed graphs (adjacency list representation).
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF DLL.
void push(const E &element, const P &priority)
Adds a new element to the queue.
void init()
Reinitializes the array. Associates the array with no graph.
T computeMinST(const Graph &G, const EdgeArray< T > &weight, EdgeArray< bool > &isInTree)
Computes a minimum spanning tree using Prim's algorithm.
void makeCConnected(ClusterGraph &C, Graph &G, List< edge > &addedEdges, bool simple=true)
Makes a cluster graph c-connected by adding edges.
void inducedSubgraph(Graph &G, NODELISTITERATOR &it, EDGELIST &E)
Computes the edges in a node-induced subgraph.
node firstNode() const
Returns the first node in the list of all nodes.
virtual void delEdge(edge e)
Removes edge e from the graph.
T makeMinimumSpanningTree(Graph &G, const EdgeArray< T > &weight)
Reduce a graph to its minimum spanning tree (MST) using Kruskal's algorithm.
bool planarSTEmbed(Graph &graph, node s, node t)
s-t-planarly embeds a graph.
node succ() const
Returns the successor in the list of all nodes.
virtual bool planarEmbed(Graph &G) override
Returns true, if G is planar, false otherwise. If true, G contains a planar embedding.
const P & priority(const E &element) const
Prioritized queue interface wrapper for heaps.
Augments any data elements of type X with keys of type Priority. This class is also its own Comparer...
Representation of clustered graphs.
virtual bool planarEmbedPlanarGraph(Graph &G) override
Constructs a planar embedding of G. G has to be planar!
internal::GraphObjectContainer< EdgeElement > edges
The container containing all edge objects.
int numberOfEdges() const
Returns the number of edges in the graph.
Dynamic arrays indexed with nodes.
const E & topElement() const
Returns the topmost element in the queue.
bool planarEmbed(Graph &G)
Returns true, if G is planar, false otherwise. If true is returned, G will be planarly embedded...
static void copy(const T &from, T &to)
edge newEdge(node v, node w)
Creates a new edge (v,w) and returns it.
void decrease(const E &element, const P &priority)
Decreases the priority of the given element.
A Union/Find data structure for maintaining disjoint sets.
bool isPlanar(const Graph &G)
Returns true, if G is planar, false otherwise.
Class for the representation of edges.
bool planarEmbedPlanarGraph(Graph &G)
Constructs a planar embedding of G. It assumes that G is planar!
Copies of graphs supporting edge splitting.
bool isCConnected(const ClusterGraph &C)
Returns true iff cluster graph C is c-connected.
Class for the representation of nodes.
Priority queue interface wrapping various heaps.
bool isSTPlanar(const Graph &graph, const node s, const node t)
Returns whether G is s-t-planar (i.e.
Declaration of the wrapper class of the Boyer-Myrvold planarity test.
bool empty() const
Checks whether the queue is empty.
adjEntry succ() const
Returns the successor in the adjacency list.
virtual bool isPlanar(const Graph &g) override
Returns true, iff a copy of the constant graph g is planar.
Implementation of disjoint sets data structures (union-find functionality).
node source() const
Returns the source node of the edge.
The namespace for all OGDF objects.
int numberOfNodes() const
Returns the number of nodes in the graph.
node newNode()
Creates a new node and returns it.
internal::GraphObjectContainer< NodeElement > nodes
The container containing all node objects.
adjEntry firstAdj() const
Returns the first entry in the adjaceny list.
Class for adjacency list elements.
#define OGDF_ASSERT(expr)
Assert condition expr. See doc/build.md for more information.
void inducedSubGraph(const Graph &G, LISTITERATOR start, Graph &subGraph)
Computes the subgraph induced by a list of nodes.
internal::GraphObjectContainer< AdjElement > adjEntries
The container containing all entries in the adjacency list of this node.