COIN-OR::LEMON - Graph Library

Changeset 1641:77f6ab7ad66f in lemon-0.x


Ignore:
Timestamp:
08/18/05 00:07:35 (19 years ago)
Author:
Alpar Juttner
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@2154
Message:

Demos' documentations include the source.

Files:
10 edited

Legend:

Unmodified
Added
Removed
  • demo/dijkstra_demo.cc

    r1636 r1641  
    2323/// facilities supplied by our implementation: for the detailed
    2424/// documentation of the LEMON Dijkstra class read \ref lemon::Dijkstra "this".
     25///
     26/// \include dijkstra_demo.cc
    2527
    2628#include <iostream>
     
    2830#include <lemon/list_graph.h>
    2931#include <lemon/dijkstra.h>
    30 //#include <lemon/graph_writer.h>
    3132
    3233using namespace lemon;
     
    7071    len.set(v5_t, 8);
    7172
    72     std::cout << "This program is a simple demo of the LEMON Dijkstra class."<<std::endl;
    73     std::cout << "We calculate the shortest path from node s to node t in a graph."<<std::endl;
    74     std::cout <<std::endl;
     73    std::cout << "This program is a simple demo of the LEMON Dijkstra class."
     74              << std::endl;
     75    std::cout <<
     76      "We calculate the shortest path from node s to node t in a graph."
     77              << std::endl;
     78    std::cout << std::endl;
    7579
    7680
    77     std::cout << "The id of s is " << g.id(s)<< ", the id of t is " << g.id(t)<<"."<<std::endl;
     81    std::cout << "The id of s is " << g.id(s)<< ", the id of t is "
     82              << g.id(t) << "." << std::endl;
    7883
    7984    std::cout << "Dijkstra algorithm demo..." << std::endl;
    80 
    8185
    8286    Dijkstra<Graph, LengthMap> dijkstra_test(g,len);
    8387   
    8488    dijkstra_test.run(s);
     89   
     90    std::cout << "The distance of node t from node s: "
     91              << dijkstra_test.dist(t) << std::endl;
    8592
     93    std::cout << "The shortest path from s to t goes through the following "
     94              << "nodes (the first one is t, the last one is s): "
     95              << std::endl;
     96
     97    for (Node v=t;v != s; v=dijkstra_test.predNode(v)) {
     98      std::cout << g.id(v) << "<-";
     99    }
    86100   
    87     std::cout << "The distance of node t from node s: " << dijkstra_test.dist(t)<<std::endl;
    88 
    89     std::cout << "The shortest path from s to t goes through the following nodes (the first one is t, the last one is s): "<<std::endl;
    90 
    91     for (Node v=t;v != s; v=dijkstra_test.predNode(v)){
    92         std::cout << g.id(v) << "<-";
    93     }
    94101    std::cout << g.id(s) << std::endl; 
    95102   
    96 
    97103    return 0;
    98104}
    99 
    100 
    101 
    102 
    103 
    104 
    105 
    106 
    107 
  • demo/dim_to_lgf.cc

    r1626 r1641  
    2121/// This program converts various DIMACS formats to the LEMON Graph Format
    2222/// (LGF).
     23///
     24/// \include dim_to_lgf.cc
    2325
    2426#include <iostream>
  • demo/graph_to_eps_demo.cc

    r1630 r1641  
    2626/// color, shape, size, title etc.) of nodes and edges individually
    2727/// using appropriate \ref maps-page "graph maps".
     28///
     29/// \include graph_to_eps_demo.cc
    2830
    2931#include <cmath>
  • demo/hello_lemon.cc

    r1636 r1641  
    2222/// the very basic notions of the LEMON library: \ref graphs "graphs" and
    2323/// \ref maps-page "maps". Click on the links to read more about these.
     24///
     25/// \include hello_lemon.cc
    2426
    2527#include <iostream>
     
    8284  std::cout <<  std::endl;
    8385  for (EdgeIt i(g); i!=INVALID; ++i)
    84     std::cout << "length(" << g.id(g.source(i)) << "," << g.id(g.target(i)) << ")="<<length[i]<<std::endl;
     86    std::cout << "length(" << g.id(g.source(i)) << ","
     87              << g.id(g.target(i)) << ")="<<length[i]<<std::endl;
    8588
    8689  std::cout << std::endl;
  • demo/kruskal_demo.cc

    r1584 r1641  
    2121/// This demo program shows how to find a minimum weight spanning tree
    2222/// in a graph by using the Kruskal algorithm.
     23///
     24/// \include kruskal_demo.cc
    2325
    2426#include <iostream>
     
    124126    std::cout << g.id(tree_edge_vec[i]) << ";" ;
    125127  std::cout << std::endl;
    126   std::cout << "The size of the tree again is: "<< tree_edge_vec.size()<< std::endl;
     128  std::cout << "The size of the tree again is: "<< tree_edge_vec.size()
     129            << std::endl;
    127130
    128131 
  • demo/lp_demo.cc

    r1636 r1641  
    2424/// example). For the detailed documentation of the LEMON LP solver
    2525/// interface read \ref lemon::LpSolverBase "this".
     26///
     27/// \include lp_demo.cc
    2628
    2729#include <lemon/lp.h>
  • demo/lp_maxflow_demo.cc

    r1610 r1641  
    2323/// the emphasis on the simplicity of the way one can formulate LP
    2424/// constraints that arise in graph theory in our library LEMON .
     25///
     26/// \include lp_maxflow_demo.cc
    2527
    2628#include<lemon/graph_reader.h>
  • demo/reader_writer_demo.cc

    r1640 r1641  
    2323/// a graph and additional maps (on the nodes or the edges) from/to a
    2424/// stream.
    25 
     25///
     26/// \include reader_writer_demo.cc
    2627
    2728#include <iostream>
  • demo/sub_graph_adaptor_demo.cc

    r1636 r1641  
    2222/// This program computes a maximum number of edge-disjoint shortest paths
    2323/// between nodes \c s and \c t.
    24 
     24///
     25/// \include sub_graph_adaptor_demo.cc
    2526
    2627// Use a DIMACS max flow file as input.
  • lemon/smart_graph.h

    r1631 r1641  
    151151    protected:
    152152      int n;
     153      ///\e
     154
    153155      ///\todo It should be removed (or at least define a setToId() instead).
    154156      ///
Note: See TracChangeset for help on using the changeset viewer.