[Lemon-user] planar embedding

Bgh Ello bgh_ello at yahoo.com
Sat Jan 28 18:02:40 CET 2012


Dear sirs,

     I am having a hard time with what seems to me should be a simple matter.  I have your latest (hg) version
of lemon, and would like to obtain some drawings of planar graphs.  The following is my attempt at just getting the
planar embedding of a simple two-vertex graph.  When trying to compile, this gives a long sequence of error
messages.  I've tried changing the template argument, but no luck.  It's probably really simple, but if you could
help me get this to work, it would be most appreciated.

     Thanks.

           Ello

---------------------------


#include <iostream>
#include <lemon/list_graph.h>
#include <lemon/planarity.h>

using namespace lemon;
using namespace std;

int main()
{
  ListGraph g;

  ListGraph::Node u = g.addNode();
  ListGraph::Node v = g.addNode();
  ListGraph::Edge  a = g.addEdge(u, v);

  cout << "Hello World! This is LEMON library here." << endl;
  cout << "We have a graph with " << countNodes(g) << " nodes "
       << "and " << countEdges(g) << " edges." << endl;

  PlanarDrawing<ListGraph> p(g);
  bool planar = p.run();
  if (planar)
     cout << "Planar" << endl;
  else
     cout << "Non-planar" << endl;

//  Next, get coords of vertices.

  return 0;
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lemon.cs.elte.hu/pipermail/lemon-user/attachments/20120128/cbc1c64a/attachment.html>


More information about the Lemon-user mailing list