Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

subgraph-planarizer.cpp
Go to the documentation of this file.
1 #include <ogdf/basic/Graph.h>
8 #include <iostream>
9 #include <string>
10 
11 using namespace ogdf;
12 
13 int main()
14 {
15  Graph G;
16  randomSimpleGraph(G, 100, 150);
17 
21 
22  int crossNum;
23  PlanRep PR(G);
24  SP.call(PR, 0, crossNum);
25 
26  std::cout << crossNum << " crossings" << std::endl;
27  GraphIO::write(PR, "output-plan.gml", GraphIO::writeGML);
28 
29  return 0;
30 }
ogdf
The namespace for all OGDF objects.
Definition: multilevelmixer.cpp:39
VariableEmbeddingInserter.h
Declaration of class VariablEmbeddingInserter.
Graph.h
Includes declaration of graph class.
graph_generators.h
Declaration of graph generators.
ogdf::GraphIO::write
static bool write(const Graph &G, const string &filename, WriterFunc writer=nullptr)
Writes graph G to a file with name filename and infers the format to use from the file's extension.
ogdf::PlanRep
Planarized representations (of a connected component) of a graph.
Definition: PlanRep.h:69
ogdf::GraphIO::writeGML
static bool writeGML(const Graph &G, std::ostream &os)
Writes graph G in GML format to output stream os.
ogdf::VariableEmbeddingInserter
Optimal edge insertion module.
Definition: VariableEmbeddingInserter.h:58
PlanarSubgraphFast.h
Declaration of the PlanarSubgraphFast.
SubgraphPlanarizer.h
Declaration of class SubgraphPlanarizer.
ogdf::SubgraphPlanarizer::setInserter
void setInserter(EdgeInsertionModule *pInserter)
Sets the module option for the edge insertion module.
Definition: SubgraphPlanarizer.h:139
ogdf::PlanarSubgraphFast
Computation of a planar subgraph using PQ-trees.
Definition: PlanarSubgraphFast.h:82
PlanRep.h
Declaration of a base class for planar representations of graphs and cluster graphs.
main
int main()
Definition: subgraph-planarizer.cpp:13
GraphIO.h
Declares class GraphIO which provides access to all graph read and write functionality.
ogdf::Graph
Data type for general directed graphs (adjacency list representation).
Definition: Graph_d.h:869
ogdf::CrossingMinimizationModule::call
ReturnType call(PlanRep &pr, int cc, int &crossingNumber, const EdgeArray< int > *pCostOrig=nullptr, const EdgeArray< bool > *pForbiddenOrig=nullptr, const EdgeArray< uint32_t > *pEdgeSubGraphs=nullptr)
Computes a planarized representation of the input graph.
Definition: CrossingMinimizationModule.h:77
ogdf::SubgraphPlanarizer::setSubgraph
void setSubgraph(PlanarSubgraphModule< int > *pSubgraph)
Sets the module option for the computation of the planar subgraph.
Definition: SubgraphPlanarizer.h:136
ogdf::SubgraphPlanarizer
The planarization approach for crossing minimization.
Definition: SubgraphPlanarizer.h:112
ogdf::randomSimpleGraph
bool randomSimpleGraph(Graph &G, int n, int m)
Creates a random simple graph.