diff -r 5fd89def7cbc -r 2b329fd595ef demo/sub_graph_adaptor_demo.cc --- a/demo/sub_graph_adaptor_demo.cc Fri Jul 22 15:03:23 2005 +0000 +++ b/demo/sub_graph_adaptor_demo.cc Fri Jul 22 15:15:29 2005 +0000 @@ -1,9 +1,31 @@ -// -*- c++ -*- +/* -*- C++ -*- + * demo/lp_maxflow_demo.cc - Part of LEMON, a generic C++ optimization library + * + * Copyright (C) 2005 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 + * purpose. + * + */ + +///\ingroup demos +///\file +///\brief Computing maximum number of edge-disjoint shortest paths +/// +/// This program computes a maximum number of edge-disjoint shortest paths +/// between nodes \c s and \c t. + // Use a DIMACS max flow file as input. // sub_graph_adaptor_demo < dimacs_max_flow_file -// This program computes a maximum number of edge-disjoint shortest paths -// between s and t. +// Modified to eat lemon graph format! + #include #include @@ -16,11 +38,9 @@ #include #include +#include -//#include -//#include - using namespace lemon; using std::cout; @@ -30,8 +50,11 @@ { if(argc<2) { - std::cerr << "USAGE: sub_graph_adaptor_demo input_file.dim" << std::endl; - std::cerr << "The file 'input_file.dim' has to contain a max flow instance in DIMACS format (e.g. sub_graph_adaptor_demo.dim is such a file)." << std::endl; + std::cerr << "USAGE: sub_graph_adaptor_demo input_file.lgf" << std::endl; + std::cerr << "The file 'input_file.lgf' has to contain a max flow " + << "instance in \n LEMON format " + << "(e.g. sub_gad_input.lgf is such a file)." + << std::endl; return 0; } @@ -51,17 +74,12 @@ Node s, t; LengthMap length(g); - readDimacs(is, g, length, s, t); + //readDimacs(is, g, length, s, t); -// GraphWriter writer(std::cout, g); -// writer.writeEdgeMap("length", length); -// writer.writeNode("source",s); -// writer.writeNode("target",t); -// writer.run(); -// GraphReader reader(is,g); -// reader.readNode("source",s).readNode("target",t) -// .readEdgeMap("length",length).run(); + GraphReader reader(is,g); + reader.readNode("source",s).readNode("target",t) + .readEdgeMap("length",length).run(); cout << "edges with lengths (of form id, source--length->target): " << endl; for(EdgeIt e(g); e!=INVALID; ++e)