42#include <ogdf/basic/internal/config_autogen.h>
60template<
class NODELISTITERATOR,
class EDGELIST>
62 NODELISTITERATOR itBegin = it;
65 for (; it.valid(); it++) {
69 for (; it.valid(); it++) {
72 edge e = adj->theEdge();
119 return computeMinST(G.firstNode(), G, weight, pred, isInTree);
136 return computeMinST(G.firstNode(), G, weight, pred, isInTree);
173 pred.
init(G,
nullptr);
175 while (!pq.
empty()) {
180 const node w = adj->twinNode();
181 const edge e = adj->theEdge();
182 if (pred[w] ==
nullptr && w != s) {
186 }
else if (!processed[w] && weight[e] < pq.
priority(w)) {
216 isInTree.
init(G,
false);
217 for (
node v = G.firstNode(); v; v = v->succ()) {
219 isInTree[pred[v]] =
true;
220 treeWeight += weight[pred[v]];
247 for (
edge e : G.edges) {
255 for (
node v : G.nodes) {
259 for (
auto prioEdge : sortEdges) {
260 const edge e = prioEdge.item();
261 const int v = setID[e->
source()];
262 const int w = setID[e->
target()];
Declaration and implementation of Array class and Array algorithms.
Declaration of the wrapper class of the Boyer-Myrvold planarity test.
Implementation of disjoint sets data structures (union-find functionality).
Includes declaration of graph class.
Declaration of graph copy classes.
Decralation of GraphElement and GraphList classes.
Priority queue interface wrapping various heaps.
Basic declarations, included by all source files.
Class for adjacency list elements.
The parameterized class Array implements dynamic arrays of type E.
void quicksort()
Sorts array using Quicksort.
Wrapper class used for preprocessing and valid invocation of the planarity test.
virtual bool planarEmbed(Graph &G) override
Returns true, if G is planar, false otherwise. If true, G contains a planar embedding.
virtual bool isPlanar(const Graph &g) override
Returns true, iff a copy of the constant graph g is planar.
virtual bool planarEmbedPlanarGraph(Graph &G) override
Constructs a planar embedding of G. G has to be planar!
Representation of clustered graphs.
A Union/Find data structure for maintaining disjoint sets.
int makeSet()
Initializes a singleton set.
int find(disjoint_sets::CompressionOption< CompressionOptions::PathCompression >, int set)
int link(disjoint_sets::LinkOption< LinkOptions::Naive >, int set1, int set2)
Class for the representation of edges.
node target() const
Returns the target node of the edge.
node source() const
Returns the source node of the edge.
Copies of graphs supporting edge splitting.
edge copy(edge e) const override
Returns the first edge in the list of edges corresponding to edge e.
edge newEdge(edge eOrig)
Creates a new edge (v,w) with original edge eOrig.
Data type for general directed graphs (adjacency list representation).
virtual void delEdge(edge e)
Removes edge e from the graph.
edge newEdge(node v, node w, int index=-1)
Creates a new edge (v,w) and returns it.
Doubly linked lists (maintaining the length of the list).
Class for the representation of nodes.
internal::GraphObjectContainer< AdjElement > adjEntries
The container containing all entries in the adjacency list of this node.
adjEntry firstAdj() const
Returns the first entry in the adjaceny list.
const Graph * graphOf() const
Returns the graph containing this node (debug only).
Augments any data elements of type X with keys of type Priority. This class is also its own Comparer.
Prioritized queue interface wrapper for heaps.
bool empty() const
Checks whether the queue is empty.
void init(const Base *base=nullptr)
Reinitializes the array. Associates the array with the matching registry of base.
RegisteredArray for edges of a graph, specialized for EdgeArray<edge>.
RegisteredArray for nodes, edges and adjEntries of a graph.
void decrease(const E &element, const P &priority)
Decreases the priority of the given element.
void pop()
Removes the topmost element from the queue.
void push(const E &element, const P &priority)
Adds a new element to the queue.
const P & priority(const E &element) const
const E & topElement() const
Returns the topmost element in the queue.
Declarations for Comparer objects.
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF dynamic library (shared object / DLL),...
Decralation of graph iterators.
void makeCConnected(ClusterGraph &C, Graph &G, List< edge > &addedEdges, bool simple=true)
Makes a cluster graph c-connected by adding edges.
bool isCConnected(const ClusterGraph &C)
Returns true iff cluster graph C is c-connected.
T makeMinimumSpanningTree(Graph &G, const EdgeArray< T > &weight)
Reduce a graph to its minimum spanning tree (MST) using Kruskal's algorithm.
T computeMinST(const Graph &G, const EdgeArray< T > &weight, EdgeArray< bool > &isInTree)
Computes a minimum spanning tree using Prim's algorithm.
bool planarEmbedPlanarGraph(Graph &G)
Constructs a planar embedding of G. It assumes that G is planar!
bool planarEmbed(Graph &G)
Returns true, if G is planar, false otherwise. If true is returned, G will be planarly embedded.
bool planarSTEmbed(Graph &graph, node s, node t)
s-t-planarly embeds a graph.
bool isSTPlanar(const Graph &graph, const node s, const node t)
Returns whether G is s-t-planar (i.e.
bool isPlanar(const Graph &G)
Returns true, if G is planar, false otherwise.
#define OGDF_ASSERT(expr)
Assert condition expr. See doc/build.md for more information.
The namespace for all OGDF objects.
void inducedSubgraph(Graph &G, NODELISTITERATOR &it, EDGELIST &E)
Computes the edges in a node-induced subgraph.