test/planarity_test.cc
changeset 1203 8c567e298d7f
parent 1181 1e5da3fc4fbc
equal deleted inserted replaced
2:9664a3b97e58 3:6e09c666bedb
    28 #include "test_tools.h"
    28 #include "test_tools.h"
    29 
    29 
    30 using namespace lemon;
    30 using namespace lemon;
    31 using namespace lemon::dim2;
    31 using namespace lemon::dim2;
    32 
    32 
    33 const int lgfn = 4;
    33 const int lgfn = 8;
    34 const std::string lgf[lgfn] = {
    34 const std::string lgf[lgfn] = {
       
    35   "@nodes\n"
       
    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 
    35   "@nodes\n"
    65   "@nodes\n"
    36   "label\n"
    66   "label\n"
    37   "0\n"
    67   "0\n"
    38   "1\n"
    68   "1\n"
    39   "2\n"
    69   "2\n"
   134       }
   164       }
   135       check(face[b] == face_num, "Wrong face");
   165       check(face[b] == face_num, "Wrong face");
   136       ++face_num;
   166       ++face_num;
   137     }
   167     }
   138   }
   168   }
   139   check(face_num + countNodes(graph) - countConnectedComponents(graph) ==
   169 
   140         countEdges(graph) + 1, "Euler test does not passed");
   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 void checkKuratowski(const Graph& graph, PE& pe) {
   176 void checkKuratowski(const Graph& graph, PE& pe) {
   144   std::map<int, int> degs;
   177   std::map<int, int> degs;
   145   for (NodeIt n(graph); n != INVALID; ++n) {
   178   for (NodeIt n(graph); n != INVALID; ++n) {