demo/dijkstra_demo.cc
changeset 1624 61cc647dac99
parent 1530 d99c3c84f797
child 1636 260ac104190f
equal deleted inserted replaced
4:771c21290c19 5:1449744fb6aa
       
     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 
     1 #include <iostream>
    26 #include <iostream>
     2 
    27 
     3 #include <lemon/list_graph.h>
    28 #include <lemon/list_graph.h>
     4 #include <lemon/dijkstra.h>
    29 #include <lemon/dijkstra.h>
     5 //#include <lemon/graph_writer.h>
    30 //#include <lemon/graph_writer.h>
    49     std::cout <<std::endl;
    74     std::cout <<std::endl;
    50 
    75 
    51 
    76 
    52     std::cout << "The id of s is " << g.id(s)<< ", the id of t is " << g.id(t)<<"."<<std::endl;
    77     std::cout << "The id of s is " << g.id(s)<< ", the id of t is " << g.id(t)<<"."<<std::endl;
    53 
    78 
    54     std::cout << "Dijkstra algorithm test..." << std::endl;
    79     std::cout << "Dijkstra algorithm demo..." << std::endl;
    55 
    80 
    56 
    81 
    57     Dijkstra<Graph, LengthMap> dijkstra_test(g,len);
    82     Dijkstra<Graph, LengthMap> dijkstra_test(g,len);
    58     
    83     
    59     dijkstra_test.run(s);
    84     dijkstra_test.run(s);