deba@426: /* -*- mode: C++; indent-tabs-mode: nil; -*- deba@426: * deba@426: * This file is a part of LEMON, a generic C++ optimization library. deba@426: * alpar@463: * Copyright (C) 2003-2009 deba@426: * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport deba@426: * (Egervary Research Group on Combinatorial Optimization, EGRES). deba@426: * deba@426: * Permission to use, modify and distribute this software is granted deba@426: * provided that this copyright notice appears in all copies. For deba@426: * precise terms see the accompanying LICENSE file. deba@426: * deba@426: * This software is provided "AS IS" with no warranty of any kind, deba@426: * express or implied, and with no claim as to its suitability for any deba@426: * purpose. deba@426: * deba@426: */ deba@426: deba@426: #include deba@426: deba@426: #include deba@426: #include deba@426: deba@426: #include deba@426: #include "test_tools.h" deba@426: deba@426: using namespace lemon; deba@426: using namespace std; deba@426: deba@426: const std::string lgf = deba@426: "@nodes\n" deba@426: "label\n" deba@426: "0\n" deba@426: "1\n" deba@426: "2\n" deba@426: "3\n" deba@426: "4\n" deba@426: "5\n" deba@426: "@edges\n" deba@426: " label capacity\n" deba@426: "0 1 0 2\n" deba@426: "1 2 1 2\n" deba@426: "2 0 2 2\n" deba@426: "3 4 3 2\n" deba@426: "4 5 4 2\n" deba@426: "5 3 5 2\n" deba@426: "2 3 6 3\n"; deba@426: deba@426: int main() { deba@426: SmartGraph graph; deba@426: SmartGraph::EdgeMap capacity(graph); deba@426: deba@426: istringstream lgfs(lgf); deba@426: graphReader(graph, lgfs). deba@426: edgeMap("capacity", capacity).run(); deba@426: deba@426: HaoOrlin > ho(graph, capacity); deba@426: ho.run(); deba@426: deba@426: check(ho.minCutValue() == 3, "Wrong cut value"); deba@426: deba@426: return 0; deba@426: }