/* -*- mode: C++; indent-tabs-mode: nil; -*-
* This file is a part of LEMON, a generic C++ optimization library.
* Copyright (C) 2003-2008
* Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
* (Egervary Research Group on Combinatorial Optimization, EGRES).
* Permission to use, modify and distribute this software is granted
* provided that this copyright notice appears in all copies. For
* precise terms see the accompanying LICENSE file.
* This software is provided "AS IS" with no warranty of any kind,
* express or implied, and with no claim as to its suitability for any
///\brief Demonstrating the usage of LEMON's General Flow algorithm
/// This demo program reads a general network circulation problem from the
/// file 'circulation-input.lgf', runs the preflow based algorithm for
/// finding a feasible solution and writes the output
/// to 'circulation-input.lgf'
/// \include circulation_demo.cc
#include <lemon/list_graph.h>
#include <lemon/circulation.h>
#include <lemon/lgf_reader.h>
typedef ListDigraph Digraph;
typedef Digraph::Node Node;
typedef Digraph::NodeIt NodeIt;
typedef Digraph::Arc Arc;
typedef Digraph::ArcIt ArcIt;
typedef Digraph::ArcMap<int> ArcMap;
typedef Digraph::NodeMap<int> NodeMap;
typedef Digraph::NodeMap<double> DNodeMap;
std::istringstream input(test_lgf);
DigraphReader<Digraph>(g,input).
Circulation<Digraph> gen(g,lo,up,delta);
check(ret,"A feasible solution should have been found.");
check(gen.checkFlow(), "The found flow is corrupt.");
check(!ret2,"A feasible solution should not have been found.");
check(gen.checkBarrier(), "The found barrier is corrupt.");