[Lemon-user] How to construct a planar drawing?
Balázs Dezső
deba.mf at gmail.com
Tue May 15 14:21:10 CEST 2018
I have also filed a bug and created a patch:
http://lemon.cs.elte.hu/trac/lemon/ticket/610
On Tue, May 15, 2018 at 2:02 PM Balázs Dezső <deba.mf at gmail.com> wrote:
> This looks to be a bug in lemon. If you need a quick workaround, then pass
> an embedding to the run() function, like here:
>
> http://lemon.cs.elte.hu/trac/lemon/browser/lemon/test/planarity_test.cc#L249
>
> On Tue, May 15, 2018 at 1:38 PM Szabolcs Horvát <szhorvat at gmail.com>
> wrote:
>
>> 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
>> _______________________________________________
>> Lemon-user mailing list
>> Lemon-user at lemon.cs.elte.hu
>> http://lemon.cs.elte.hu/mailman/listinfo/lemon-user
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lemon.cs.elte.hu/pipermail/lemon-user/attachments/20180515/1b19a304/attachment-0001.html>
More information about the Lemon-user
mailing list