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