1 | #include <ogdf/basic/graph_generators.h> |
---|---|
2 | #include <ogdf/planarity/SubgraphPlanarizer.h> |
3 | #include <ogdf/planarity/PlanarSubgraphFast.h> |
4 | #include <ogdf/planarity/VariableEmbeddingInserter.h> |
5 | #include <ogdf/fileformats/GraphIO.h> |
6 | |
7 | using namespace ogdf; |
8 | |
9 | int main() |
10 | { |
11 | Graph G; |
12 | randomSimpleGraph(G, 100, 150); |
13 | |
14 | SubgraphPlanarizer SP; |
15 | SP.setSubgraph(new PlanarSubgraphFast<int>); |
16 | SP.setInserter(new VariableEmbeddingInserter); |
17 | |
18 | int crossNum; |
19 | PlanRep PR(G); |
20 | SP.call(PR, 0, crossNum); |
21 | |
22 | std::cout << crossNum << " crossings"<< std::endl; |
23 | GraphIO::write(PR, "output-plan.gml", GraphIO::writeGML); |
24 | |
25 | return 0; |
26 | } |
27 |