diff -r 57167d92e96c lemon/planarity.h
a
|
b
|
|
2398 | 2398 | void run(const EmbeddingMap& embedding) { |
2399 | 2399 | typedef SmartEdgeSet<Graph> AuxGraph; |
2400 | 2400 | |
| 2401 | if (countNodes(_graph) < 3) { |
| 2402 | int y = 0; |
| 2403 | for (typename Graph::NodeIt n(_graph); n != INVALID; ++n) { |
| 2404 | _point_map[n].x = 0; |
| 2405 | _point_map[n].y = y++; |
| 2406 | } |
| 2407 | return; |
| 2408 | } |
| 2409 | |
2401 | 2410 | if (3 * countNodes(_graph) - 6 == countEdges(_graph)) { |
2402 | 2411 | drawing(_graph, embedding, _point_map); |
2403 | 2412 | return; |
diff -r 57167d92e96c test/planarity_test.cc
a
|
b
|
|
30 | 30 | using namespace lemon; |
31 | 31 | using namespace lemon::dim2; |
32 | 32 | |
33 | | const int lgfn = 4; |
| 33 | const int lgfn = 8; |
34 | 34 | const std::string lgf[lgfn] = { |
35 | 35 | "@nodes\n" |
36 | 36 | "label\n" |
| 37 | "@edges\n" |
| 38 | " label\n", |
| 39 | |
| 40 | "@nodes\n" |
| 41 | "label\n" |
| 42 | "0\n" |
| 43 | "@edges\n" |
| 44 | " label\n", |
| 45 | |
| 46 | "@nodes\n" |
| 47 | "label\n" |
| 48 | "0\n" |
| 49 | "1\n" |
| 50 | "@edges\n" |
| 51 | " label\n" |
| 52 | "0 1 0\n", |
| 53 | |
| 54 | "@nodes\n" |
| 55 | "label\n" |
| 56 | "0\n" |
| 57 | "1\n" |
| 58 | "2\n" |
| 59 | "@edges\n" |
| 60 | " label\n" |
| 61 | "0 1 0\n" |
| 62 | "1 2 1\n" |
| 63 | "2 0 2\n", |
| 64 | |
| 65 | "@nodes\n" |
| 66 | "label\n" |
37 | 67 | "0\n" |
38 | 68 | "1\n" |
39 | 69 | "2\n" |
… |
… |
|
136 | 166 | ++face_num; |
137 | 167 | } |
138 | 168 | } |
139 | | check(face_num + countNodes(graph) - countConnectedComponents(graph) == |
140 | | countEdges(graph) + 1, "Euler test does not passed"); |
| 169 | |
| 170 | if (face_num != 0) { |
| 171 | check(face_num + countNodes(graph) - countConnectedComponents(graph) == |
| 172 | countEdges(graph) + 1, "Euler test does not passed"); |
| 173 | } |
141 | 174 | } |
142 | 175 | |
143 | 176 | void checkKuratowski(const Graph& graph, PE& pe) { |