COIN-OR::LEMON - Graph Library

Changeset 1583:2b329fd595ef in lemon-0.x


Ignore:
Timestamp:
07/22/05 17:15:29 (14 years ago)
Author:
athos
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@2085
Message:

Documented some more demo programs.

Location:
demo
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • demo/dijkstra_demo.cc

    r1530 r1583  
     1/* -*- C++ -*-
     2 * demo/lp_maxflow_demo.cc - Part of LEMON, a generic C++ optimization library
     3 *
     4 * Copyright (C) 2005 Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
     5 * (Egervary Research Group on Combinatorial Optimization, EGRES).
     6 *
     7 * Permission to use, modify and distribute this software is granted
     8 * provided that this copyright notice appears in all copies. For
     9 * precise terms see the accompanying LICENSE file.
     10 *
     11 * This software is provided "AS IS" with no warranty of any kind,
     12 * express or implied, and with no claim as to its suitability for any
     13 * purpose.
     14 *
     15 */
     16
     17///\ingroup demos
     18///\file
     19///\brief Demonstrating LEMON implementation of the Dijkstra algorithm
     20///
     21/// Dijkstra's algorithm computes shortest paths between two nodes in
     22/// a graph with edge lengths. Here we only show some of the
     23/// facilities supplied by our implementation: for the detailed
     24/// documentation of the LEMON Dijkstra class read \ref lemon::Dijkstra "this".
     25
    126#include <iostream>
    227
     
    5277    std::cout << "The id of s is " << g.id(s)<< ", the id of t is " << g.id(t)<<"."<<std::endl;
    5378
    54     std::cout << "Dijkstra algorithm test..." << std::endl;
     79    std::cout << "Dijkstra algorithm demo..." << std::endl;
    5580
    5681
  • demo/hello_lemon.cc

    r1530 r1583  
     1/* -*- C++ -*-
     2 * demo/lp_maxflow_demo.cc - Part of LEMON, a generic C++ optimization library
     3 *
     4 * Copyright (C) 2005 Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
     5 * (Egervary Research Group on Combinatorial Optimization, EGRES).
     6 *
     7 * Permission to use, modify and distribute this software is granted
     8 * provided that this copyright notice appears in all copies. For
     9 * precise terms see the accompanying LICENSE file.
     10 *
     11 * This software is provided "AS IS" with no warranty of any kind,
     12 * express or implied, and with no claim as to its suitability for any
     13 * purpose.
     14 *
     15 */
     16
     17///\ingroup demos
     18///\file
     19///\brief LEMON style "Hello World!" program
     20///
     21/// This program is intended to be a "Hello World!" program that shows
     22/// the very basic notions of the LEMON library: \ref graphs "graphs" and
     23/// \ref maps-page "maps". Click on the links to read more about these.
     24
    125#include <iostream>
    226#include <lemon/list_graph.h>
  • demo/kruskal_demo.cc

    r1580 r1583  
    1919///\brief Minimum weight spanning tree by Kruskal algorithm (demo).
    2020///
    21 ///This demo program shows how to find a minimum weight spannin tree
    22 ///of a graph by using the Kruskal algorithm.
     21/// This demo program shows how to find a minimum weight spanning tree
     22/// in a graph by using the Kruskal algorithm.
    2323
    2424#include <iostream>
  • demo/lp_maxflow_demo.cc

    r1577 r1583  
    1919///\brief Max flow problem solved with an LP solver (demo).
    2020///
    21 ///This demo program shows how to solve a maximum (or maximal) flow
    22 ///problem using the LEMON LP solver interface. We would like to lay
    23 ///the emphasis on the simplicity of the way one can formulate the LP
    24 ///constraints with LEMON that arise in graph theory.
     21/// This demo program shows how to solve a maximum (or maximal) flow
     22/// problem using the LEMON LP solver interface. We would like to lay
     23/// the emphasis on the simplicity of the way one can formulate LP
     24/// constraints that arise in graph theory in our library LEMON .
    2525
    2626#ifdef HAVE_CONFIG_H
  • demo/reader_writer_demo.cc

    r1534 r1583  
     1/* -*- C++ -*-
     2 * demo/lp_maxflow_demo.cc - Part of LEMON, a generic C++ optimization library
     3 *
     4 * Copyright (C) 2005 Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
     5 * (Egervary Research Group on Combinatorial Optimization, EGRES).
     6 *
     7 * Permission to use, modify and distribute this software is granted
     8 * provided that this copyright notice appears in all copies. For
     9 * precise terms see the accompanying LICENSE file.
     10 *
     11 * This software is provided "AS IS" with no warranty of any kind,
     12 * express or implied, and with no claim as to its suitability for any
     13 * purpose.
     14 *
     15 */
     16
     17///\ingroup demos
     18///\file
     19///\brief Demonstrating graph input and output
     20///
     21/// This simple demo program gives an example of how to read and write
     22/// a graph and additional maps (on the nodes or the edges) from/to a
     23/// stream.
     24
     25
    126#include <iostream>
    227#include <lemon/smart_graph.h>
     
    1944
    2045    std::cout << "Hello! We have read a graph from file " << filename<<
    21       " and some maps on it: now we write this to the standard output!" <<
     46      " and some maps on it:\n now we write it to the standard output!" <<
    2247      std::endl;
    2348
  • demo/sub_graph_adaptor_demo.cc

    r1577 r1583  
    1 // -*- c++ -*-
     1/* -*- C++ -*-
     2 * demo/lp_maxflow_demo.cc - Part of LEMON, a generic C++ optimization library
     3 *
     4 * Copyright (C) 2005 Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
     5 * (Egervary Research Group on Combinatorial Optimization, EGRES).
     6 *
     7 * Permission to use, modify and distribute this software is granted
     8 * provided that this copyright notice appears in all copies. For
     9 * precise terms see the accompanying LICENSE file.
     10 *
     11 * This software is provided "AS IS" with no warranty of any kind,
     12 * express or implied, and with no claim as to its suitability for any
     13 * purpose.
     14 *
     15 */
     16
     17///\ingroup demos
     18///\file
     19///\brief Computing maximum number of edge-disjoint shortest paths
     20///
     21/// This program computes a maximum number of edge-disjoint shortest paths
     22/// between nodes \c s and \c t.
     23
    224
    325// Use a DIMACS max flow file as input.
    426// sub_graph_adaptor_demo < dimacs_max_flow_file
    5 // This program computes a maximum number of edge-disjoint shortest paths
    6 // between s and t.
     27// Modified to eat lemon graph format!
     28
    729
    830#include <iostream>
     
    1739#include <tight_edge_filter_map.h>
    1840
     41#include <lemon/graph_reader.h>
    1942
    20 
    21 //#include <lemon/graph_reader.h>
    22 //#include <lemon/graph_writer.h>
    2343
    2444using namespace lemon;
     
    3151  if(argc<2)
    3252  {
    33       std::cerr << "USAGE: sub_graph_adaptor_demo input_file.dim" << std::endl;
    34       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;
     53      std::cerr << "USAGE: sub_graph_adaptor_demo input_file.lgf" << std::endl;
     54      std::cerr << "The file 'input_file.lgf' has to contain a max flow "
     55                << "instance in \n LEMON format "
     56                << "(e.g. sub_gad_input.lgf is such a file)."
     57                << std::endl;
    3558      return 0;
    3659  }
     
    5275  LengthMap length(g);
    5376
    54   readDimacs(is, g, length, s, t);
     77  //readDimacs(is, g, length, s, t);
    5578
    56 //     GraphWriter<SmartGraph> writer(std::cout, g);
    57 //     writer.writeEdgeMap("length", length);
    58 //     writer.writeNode("source",s);
    59 //     writer.writeNode("target",t);
    60 //     writer.run();
    6179
    62 //   GraphReader<ListGraph> reader(is,g);
    63 //   reader.readNode("source",s).readNode("target",t)
    64 //     .readEdgeMap("length",length).run();
     80  GraphReader<SmartGraph> reader(is,g);
     81  reader.readNode("source",s).readNode("target",t)
     82    .readEdgeMap("length",length).run();
    6583
    6684  cout << "edges with lengths (of form id, source--length->target): " << endl;
Note: See TracChangeset for help on using the changeset viewer.