test/dfs_test.cc
branch1.0
changeset 1123 351009ebb624
parent 1007 e24922c56bc2
equal deleted inserted replaced
10:c3f2cda538b9 13:5e2e5eb98b91
     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-2008
     5  * Copyright (C) 2003-2011
     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
   182 
   182 
   183   {
   183   {
   184   Dfs<Digraph> dfs(G);
   184   Dfs<Digraph> dfs(G);
   185   check(dfs.run(s1,t1) && dfs.reached(t1),"Node 3 is reachable from Node 6.");
   185   check(dfs.run(s1,t1) && dfs.reached(t1),"Node 3 is reachable from Node 6.");
   186   }
   186   }
   187   
   187 
   188   {
   188   {
   189     NullMap<Node,Arc> myPredMap;
   189     NullMap<Node,Arc> myPredMap;
   190     dfs(G).predMap(myPredMap).run(s);
   190     dfs(G).predMap(myPredMap).run(s);
   191   }
   191   }
   192 }
   192 }