[Lemon-user] How to construct a planar drawing?
Szabolcs Horvát
szhorvat at gmail.com
Tue May 15 13:37:41 CEST 2018
Hello everyone,
I am new to Lemon, and I am trying to construct a PlanarDrawing of a graph.
It's not working, and I'm not quite sure what I am doing wrong. The
analogous way of using PlanarEmbedding worked fine.
Here's a minimal example (to be compiled as C++11):
#include <lemon/static_graph.h>
#include <lemon/planarity.h>
#include <utility>
#include <vector>
#include <iostream>
using namespace lemon;
using namespace std;
int main() {
StaticDigraph digraph;
vector<pair<int,int>> edges = {{0, 1}, {0, 2}, {1, 2}}; // already sorted
digraph.build(3, edges.begin(), edges.end());
typedef Undirector<StaticDigraph> Graph;
Graph graph (digraph);
PlanarDrawing<Graph> drawing(graph);
drawing.run();
return 0;
}
The error I get is:
type 'const lemon::PlanarEmbedding<lemon::Undirector<lemon::StaticDigraph>
>' does not provide a subscript operator
Arc ee = embedding[_graph.direct(e, true)];
I'm not quite sure what to make of it.
Can anyone point out my mistake?
Best regards,
Szabolcs
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lemon.cs.elte.hu/pipermail/lemon-user/attachments/20180515/796543ae/attachment.html>
More information about the Lemon-user
mailing list