src/work/athos/mincostflows.h
changeset 524 bd8109f8e2fa
parent 520 e4a6300616f9
child 527 7550fed0cd91
equal deleted inserted replaced
14:e22010977cf9 0:aa639ba96571
     1 // -*- c++ -*-
     1 // -*- c++ -*-
     2 #ifndef HUGO_MINLENGTHPATHS_H
     2 #ifndef HUGO_MINCOSTFLOWS_H
     3 #define HUGO_MINLENGTHPATHS_H
     3 #define HUGO_MINCOSTFLOWS_H
     4 
     4 
     5 ///\ingroup galgs
     5 ///\ingroup galgs
     6 ///\file
     6 ///\file
     7 ///\brief An algorithm for finding k paths of minimal total length.
     7 ///\brief An algorithm for finding a flow of value \c k (for small values of \c k) having minimal total cost 
     8 
     8 
     9 #include <iostream>
     9 #include <iostream>
    10 #include <dijkstra.h>
    10 #include <dijkstra.h>
    11 #include <graph_wrapper.h>
    11 #include <graph_wrapper.h>
    12 #include <maps.h>
    12 #include <maps.h>
    16 namespace hugo {
    16 namespace hugo {
    17 
    17 
    18 /// \addtogroup galgs
    18 /// \addtogroup galgs
    19 /// @{
    19 /// @{
    20 
    20 
    21   ///\brief Implementation of an algorithm for finding k paths between 2 nodes 
    21   ///\brief Implementation of an algorithm for finding a flow of value \c k 
    22   /// of minimal total length 
    22   ///(for small values of \c k) having minimal total cost between 2 nodes 
       
    23   /// 
    23   ///
    24   ///
    24   /// The class \ref hugo::MinLengthPaths "MinLengthPaths" implements
    25   /// The class \ref hugo::MinCostFlows "MinCostFlows" implements
    25   /// an algorithm for finding k edge-disjoint paths
    26   /// an algorithm for finding a flow of value \c k 
       
    27   ///(for small values of \c k) having minimal total cost  
    26   /// from a given source node to a given target node in an
    28   /// from a given source node to a given target node in an
    27   /// edge-weighted directed graph having minimal total weigth (length).
    29   /// edge-weighted directed graph having nonnegative integer capacities.
       
    30   /// The range of the length (weight) function is nonnegative reals but 
       
    31   /// the range of capacity function is the set of nonnegative integers. 
       
    32   /// It is not a polinomial time algorithm for counting the minimum cost
       
    33   /// maximal flow, since it counts the minimum cost flow for every value 0..M
       
    34   /// where \c M is the value of the maximal flow.
    28   ///
    35   ///
    29   ///\author Attila Bernath
    36   ///\author Attila Bernath
    30   template <typename Graph, typename LengthMap>
    37   template <typename Graph, typename LengthMap>
    31   class MinLengthPaths {
    38   class MinCostFlows {
    32 
    39 
    33     typedef typename LengthMap::ValueType Length;
    40     typedef typename LengthMap::ValueType Length;
    34     
    41     
    35     typedef typename Graph::Node Node;
    42     typedef typename Graph::Node Node;
    36     typedef typename Graph::NodeIt NodeIt;
    43     typedef typename Graph::NodeIt NodeIt;