Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

Loading...
Searching...
No Matches
operations.h
Go to the documentation of this file.
1
32#pragma once
33
34#include <ogdf/basic/Graph.h>
35#include <ogdf/basic/basic.h>
36
37#include <functional>
38
39namespace ogdf {
40
48
55inline void graphUnion(Graph& G1, const Graph& G2) { G1.insert(G2); }
56
72OGDF_EXPORT void graphUnion(Graph& G1, const Graph& G2, NodeArray<node>& map2to1,
73 bool parallelfree = false, bool directed = false);
74
76
91OGDF_EXPORT void graphProduct(const Graph& G1, const Graph& G2, Graph& product,
92 NodeMap& nodeInProduct, const std::function<void(node, node)>& addEdges);
93
110OGDF_EXPORT void cartesianProduct(const Graph& G1, const Graph& G2, Graph& product,
111 NodeMap& nodeInProduct);
112
122OGDF_EXPORT void tensorProduct(const Graph& G1, const Graph& G2, Graph& product,
123 NodeMap& nodeInProduct);
124
137OGDF_EXPORT void lexicographicalProduct(const Graph& G1, const Graph& G2, Graph& product,
138 NodeMap& nodeInProduct);
139
153OGDF_EXPORT void strongProduct(const Graph& G1, const Graph& G2, Graph& product,
154 NodeMap& nodeInProduct);
155
165OGDF_EXPORT void coNormalProduct(const Graph& G1, const Graph& G2, Graph& product,
166 NodeMap& nodeInProduct);
167
179OGDF_EXPORT void modularProduct(const Graph& G1, const Graph& G2, Graph& product,
180 NodeMap& nodeInProduct);
181
190OGDF_EXPORT void rootedProduct(const Graph& G1, const Graph& G2, Graph& product,
191 NodeMap& nodeInProduct, node rootInG2);
192
200OGDF_EXPORT void complement(Graph& G, bool directed = false, bool allowSelfLoops = false);
201
214OGDF_EXPORT void intersection(Graph& G1, const Graph& G2, const NodeArray<node>& nodeMap,
215 bool directed = false);
216
226OGDF_EXPORT void join(Graph& G1, const Graph& G2, NodeArray<node>& nodeMap, EdgeArray<edge>& edgeMap);
227
228
230
232}
Includes declaration of graph class.
Basic declarations, included by all source files.
Data type for general directed graphs (adjacency list representation).
Definition Graph_d.h:866
std::pair< int, int > insert(const NI &nodesBegin, const NI &nodesEnd, const EI &edgesBegin, const EI &edgesEnd, NodeArray< node > &nodeMap, EdgeArray< edge > &edgeMap)
Inserts a copy of a given subgraph into this graph.
Class for the representation of nodes.
Definition Graph_d.h:241
RegisteredArray for edges of a graph, specialized for EdgeArray<edge>.
Definition Graph_d.h:717
RegisteredArray for nodes, edges and adjEntries of a graph.
Definition Graph_d.h:659
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF dynamic library (shared object / DLL),...
Definition config.h:117
void modularProduct(const Graph &G1, const Graph &G2, Graph &product, NodeMap &nodeInProduct)
Computes the modular product of G1 and G2 and assigns it to product, with .
void join(Graph &G1, const Graph &G2, NodeArray< node > &nodeMap, EdgeArray< edge > &edgeMap)
Computes the graph join of G1 and G2.
void graphProduct(const Graph &G1, const Graph &G2, Graph &product, NodeMap &nodeInProduct, const std::function< void(node, node)> &addEdges)
Computes the graph product of G1 and G2, using a given function to add edges.
void tensorProduct(const Graph &G1, const Graph &G2, Graph &product, NodeMap &nodeInProduct)
Computes the tensor product of G1 and G2 and assigns it to product, with .
void lexicographicalProduct(const Graph &G1, const Graph &G2, Graph &product, NodeMap &nodeInProduct)
Computes the lexicographical product of G1 and G2 and assigns it to product, with .
void strongProduct(const Graph &G1, const Graph &G2, Graph &product, NodeMap &nodeInProduct)
Computes the strong product of G1 and G2 and assigns it to product, with .
void coNormalProduct(const Graph &G1, const Graph &G2, Graph &product, NodeMap &nodeInProduct)
Computes the co-normal product of G1 and G2 and assigns it to product, with .
void rootedProduct(const Graph &G1, const Graph &G2, Graph &product, NodeMap &nodeInProduct, node rootInG2)
Computes the rooted product of G1 and G2, rooted in rootInG2, and assigns it to product.
void complement(Graph &G, bool directed=false, bool allowSelfLoops=false)
Computes the complement of G.
void graphUnion(Graph &G1, const Graph &G2)
Forms the disjoint union of G1 and G2.
Definition operations.h:55
void cartesianProduct(const Graph &G1, const Graph &G2, Graph &product, NodeMap &nodeInProduct)
Computes the Cartesian product of G1 and G2 and assigns it to product, with .
void intersection(Graph &G1, const Graph &G2, const NodeArray< node > &nodeMap, bool directed=false)
Computes the intersection of G1 and G2.
The namespace for all OGDF objects.