|
Open Graph Drawing Framework |
v. 2023.09 (Elderberry)
|
|
|
Go to the documentation of this file.
60 template<
class NODELISTITERATOR,
class EDGELIST>
62 NODELISTITERATOR itBegin = it;
65 for (; it.valid(); it++) {
69 for (; it.valid(); it++) {
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()];
The namespace for all OGDF objects.
Declaration of the wrapper class of the Boyer-Myrvold planarity test.
virtual bool planarEmbed(Graph &G) override
Returns true, if G is planar, false otherwise. If true, G contains a planar embedding.
Includes declaration of graph class.
#define OGDF_ASSERT(expr)
Assert condition expr. See doc/build.md for more information.
void pop()
Removes the topmost element from the queue.
void inducedSubgraph(Graph &G, NODELISTITERATOR &it, EDGELIST &E)
Computes the edges in a node-induced subgraph.
Priority queue interface wrapping various heaps.
void makeCConnected(ClusterGraph &C, Graph &G, List< edge > &addedEdges, bool simple=true)
Makes a cluster graph c-connected by adding edges.
void push(const E &element, const P &priority)
Adds a new element to the queue.
int find(disjoint_sets::CompressionOption< CompressionOptions::PathCompression >, int set)
virtual bool planarEmbedPlanarGraph(Graph &G) override
Constructs a planar embedding of G. G has to be planar!
T computeMinST(const Graph &G, const EdgeArray< T > &weight, EdgeArray< bool > &isInTree)
Computes a minimum spanning tree using Prim's algorithm.
Copies of graphs supporting edge splitting.
int makeSet()
Initializes a singleton set.
const P & priority(const E &element) const
bool isPlanar(const Graph &G)
Returns true, if G is planar, false otherwise.
virtual void delEdge(edge e)
Removes edge e from the graph.
bool planarSTEmbed(Graph &graph, node s, node t)
s-t-planarly embeds a graph.
Class for adjacency list elements.
virtual bool isPlanar(const Graph &g) override
Returns true, iff a copy of the constant graph g is planar.
edge theEdge() const
Returns the edge associated with this adjacency entry.
bool empty() const
Checks whether the queue is empty.
int link(disjoint_sets::LinkOption< LinkOptions::Naive >, int set1, int set2)
static void copy(const T &from, T &to)
A Union/Find data structure for maintaining disjoint sets.
The parameterized class Array implements dynamic arrays of type E.
Decralation of GraphElement and GraphList classes.
adjEntry succ() const
Returns the successor in the adjacency list.
Prioritized queue interface wrapper for heaps.
internal::GraphObjectContainer< AdjElement > adjEntries
The container containing all entries in the adjacency list of this node.
bool planarEmbed(Graph &G)
Returns true, if G is planar, false otherwise. If true is returned, G will be planarly embedded.
node source() const
Returns the source node of the edge.
Declaration of graph copy classes.
RegisteredArray for nodes, edges and adjEntries of a graph.
Data type for general directed graphs (adjacency list representation).
const E & topElement() const
Returns the topmost element in the queue.
Decralation of graph iterators.
Wrapper class used for preprocessing and valid invocation of the planarity test.
void decrease(const E &element, const P &priority)
Decreases the priority of the given element.
Basic declarations, included by all source files.
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF DLL.
adjEntry firstAdj() const
Returns the first entry in the adjaceny list.
T makeMinimumSpanningTree(Graph &G, const EdgeArray< T > &weight)
Reduce a graph to its minimum spanning tree (MST) using Kruskal's algorithm.
Implementation of disjoint sets data structures (union-find functionality).
Declaration and implementation of Array class and Array algorithms.
bool isCConnected(const ClusterGraph &C)
Returns true iff cluster graph C is c-connected.
Augments any data elements of type X with keys of type Priority. This class is also its own Comparer.
Class for the representation of edges.
const Graph * graphOf() const
Returns the graph containing this node (debug only).
void init(const Graph *base=nullptr)
Reinitializes the array. Associates the array with the matching registry of base.
void quicksort()
Sorts array using Quicksort.
bool planarEmbedPlanarGraph(Graph &G)
Constructs a planar embedding of G. It assumes that G is planar!
node target() const
Returns the target node of the edge.
edge newEdge(node v, node w, int index=-1)
Creates a new edge (v,w) and returns it.
Declarations for Comparer objects.
Class for the representation of nodes.
bool isSTPlanar(const Graph &graph, const node s, const node t)
Returns whether G is s-t-planar (i.e.
RegisteredArray for edges of a graph, specialized for EdgeArray<edge>.