test/graph_test.h
changeset 217 b67149f0e675
parent 171 02f4d5d9bfd7
child 220 a5d8c039f218
equal deleted inserted replaced
0:c12cbd63bf92 1:786d1d22e992
     1 /* -*- C++ -*-
     1 /* -*- mode: C++; indent-tabs-mode: nil; -*-
     2  *
     2  *
     3  * This file is a part of LEMON, a generic C++ optimization library
     3  * This file is a part of LEMON, a generic C++ optimization library.
     4  *
     4  *
     5  * Copyright (C) 2003-2008
     5  * Copyright (C) 2003-2008
     6  * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
     6  * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
     7  * (Egervary Research Group on Combinatorial Optimization, EGRES).
     7  * (Egervary Research Group on Combinatorial Optimization, EGRES).
     8  *
     8  *
   215     for(int i=0;i<num;i++) {
   215     for(int i=0;i<num;i++) {
   216       n.chords.push_back(G.addEdge(n.outer[i],n.inner[i]));
   216       n.chords.push_back(G.addEdge(n.outer[i],n.inner[i]));
   217       n.outcir.push_back(G.addEdge(n.outer[i],n.outer[(i+1)%num]));
   217       n.outcir.push_back(G.addEdge(n.outer[i],n.outer[(i+1)%num]));
   218       n.incir.push_back(G.addEdge(n.inner[i],n.inner[(i+2)%num]));
   218       n.incir.push_back(G.addEdge(n.inner[i],n.inner[(i+2)%num]));
   219     }
   219     }
   220     
   220 
   221     return n;
   221     return n;
   222   }
   222   }
   223 
   223 
   224   // Checks the undirected Petersen graph
   224   // Checks the undirected Petersen graph
   225   template<class Graph>
   225   template<class Graph>
   244     checkGraphArcList(G, 0);
   244     checkGraphArcList(G, 0);
   245     addPetersen(G, num);
   245     addPetersen(G, num);
   246     bidirDigraph(G);
   246     bidirDigraph(G);
   247     checkBidirPetersen(G, num);
   247     checkBidirPetersen(G, num);
   248   }
   248   }
   249   
   249 
   250   template <class Graph>
   250   template <class Graph>
   251   void checkGraph() {
   251   void checkGraph() {
   252     const int num = 5;
   252     const int num = 5;
   253     Graph G;
   253     Graph G;
   254     checkGraphNodeList(G, 0);
   254     checkGraphNodeList(G, 0);