test/dfs_test.cc
changeset 1197 f179aa1045a4
parent 1086 97f1760dcd13
equal deleted inserted replaced
20:5108e8df9bf8 21:578edf527b19
     1 /* -*- mode: C++; indent-tabs-mode: nil; -*-
     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-2010
     5  * Copyright (C) 2003-2013
     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  *
     9  * Permission to use, modify and distribute this software is granted
     9  * Permission to use, modify and distribute this software is granted
    10  * provided that this copyright notice appears in all copies. For
    10  * provided that this copyright notice appears in all copies. For
   221 
   221 
   222   {
   222   {
   223   Dfs<Digraph> dfs(G);
   223   Dfs<Digraph> dfs(G);
   224   check(dfs.run(s1,t1) && dfs.reached(t1),"Node 3 is reachable from Node 6.");
   224   check(dfs.run(s1,t1) && dfs.reached(t1),"Node 3 is reachable from Node 6.");
   225   }
   225   }
   226   
   226 
   227   {
   227   {
   228     NullMap<Node,Arc> myPredMap;
   228     NullMap<Node,Arc> myPredMap;
   229     dfs(G).predMap(myPredMap).run(s);
   229     dfs(G).predMap(myPredMap).run(s);
   230   }
   230   }
   231 }
   231 }