diff -r cd72eae05bdf -r 3c00344f49c9 lemon/planarity.h --- a/lemon/planarity.h Mon Jul 16 16:21:40 2018 +0200 +++ b/lemon/planarity.h Wed Oct 17 19:14:07 2018 +0200 @@ -2,7 +2,7 @@ * * This file is a part of LEMON, a generic C++ optimization library. * - * Copyright (C) 2003-2010 + * Copyright (C) 2003-2013 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport * (Egervary Research Group on Combinatorial Optimization, EGRES). * @@ -72,7 +72,6 @@ } void discover(const Arc& arc) { - Node source = _graph.source(arc); Node target = _graph.target(arc); _tree_map[arc] = true; @@ -2384,7 +2383,7 @@ PlanarEmbedding pe(_graph); if (!pe.run()) return false; - run(pe); + run(pe.embeddingMap()); return true; } @@ -2399,6 +2398,15 @@ void run(const EmbeddingMap& embedding) { typedef SmartEdgeSet AuxGraph; + if (countNodes(_graph) < 3) { + int y = 0; + for (typename Graph::NodeIt n(_graph); n != INVALID; ++n) { + _point_map[n].x = 0; + _point_map[n].y = y++; + } + return; + } + if (3 * countNodes(_graph) - 6 == countEdges(_graph)) { drawing(_graph, embedding, _point_map); return;