lemon/lp.h
author Peter Kovacs <kpeter@inf.elte.hu>
Thu, 12 Nov 2009 23:26:13 +0100
changeset 806 fa6f37d7a25b
parent 462 9b082b3fb33f
child 877 141f9c0db4a3
permissions -rw-r--r--
Entirely rework CapacityScaling (#180)

- Use the new interface similarly to NetworkSimplex.
- Rework the implementation using an efficient internal structure
for handling the residual network. This improvement made the
code much faster (up to 2-5 times faster on large graphs).
- Handle GEQ supply type (LEQ is not supported).
- Handle negative costs for arcs of finite capacity.
(Note that this algorithm cannot handle arcs of negative cost
and infinite upper bound, thus it returns UNBOUNDED if such
an arc exists.)
- Extend the documentation.
     1 /* -*- mode: C++; indent-tabs-mode: nil; -*-
     2  *
     3  * This file is a part of LEMON, a generic C++ optimization library.
     4  *
     5  * Copyright (C) 2003-2008
     6  * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
     7  * (Egervary Research Group on Combinatorial Optimization, EGRES).
     8  *
     9  * Permission to use, modify and distribute this software is granted
    10  * provided that this copyright notice appears in all copies. For
    11  * precise terms see the accompanying LICENSE file.
    12  *
    13  * This software is provided "AS IS" with no warranty of any kind,
    14  * express or implied, and with no claim as to its suitability for any
    15  * purpose.
    16  *
    17  */
    18 
    19 #ifndef LEMON_LP_H
    20 #define LEMON_LP_H
    21 
    22 #include<lemon/config.h>
    23 
    24 
    25 #ifdef LEMON_HAVE_GLPK
    26 #include <lemon/glpk.h>
    27 #elif LEMON_HAVE_CPLEX
    28 #include <lemon/cplex.h>
    29 #elif LEMON_HAVE_SOPLEX
    30 #include <lemon/soplex.h>
    31 #elif LEMON_HAVE_CLP
    32 #include <lemon/clp.h>
    33 #endif
    34 
    35 ///\file
    36 ///\brief Defines a default LP solver
    37 ///\ingroup lp_group
    38 namespace lemon {
    39 
    40 #ifdef DOXYGEN
    41   ///The default LP solver identifier
    42 
    43   ///The default LP solver identifier.
    44   ///\ingroup lp_group
    45   ///
    46   ///Currently, the possible values are \c GLPK, \c CPLEX,
    47   ///\c SOPLEX or \c CLP
    48 #define LEMON_DEFAULT_LP SOLVER
    49   ///The default LP solver
    50 
    51   ///The default LP solver.
    52   ///\ingroup lp_group
    53   ///
    54   ///Currently, it is either \c GlpkLp, \c CplexLp, \c SoplexLp or \c ClpLp
    55   typedef GlpkLp Lp;
    56 
    57   ///The default MIP solver identifier
    58 
    59   ///The default MIP solver identifier.
    60   ///\ingroup lp_group
    61   ///
    62   ///Currently, the possible values are \c GLPK or \c CPLEX
    63 #define LEMON_DEFAULT_MIP SOLVER
    64   ///The default MIP solver.
    65 
    66   ///The default MIP solver.
    67   ///\ingroup lp_group
    68   ///
    69   ///Currently, it is either \c GlpkMip or \c CplexMip
    70   typedef GlpkMip Mip;
    71 #else
    72 #ifdef LEMON_HAVE_GLPK
    73 # define LEMON_DEFAULT_LP GLPK
    74   typedef GlpkLp Lp;
    75 # define LEMON_DEFAULT_MIP GLPK
    76   typedef GlpkMip Mip;
    77 #elif LEMON_HAVE_CPLEX
    78 # define LEMON_DEFAULT_LP CPLEX
    79   typedef CplexLp Lp;
    80 # define LEMON_DEFAULT_MIP CPLEX
    81   typedef CplexMip Mip;
    82 #elif LEMON_HAVE_SOPLEX
    83 # define DEFAULT_LP SOPLEX
    84   typedef SoplexLp Lp;
    85 #elif LEMON_HAVE_CLP
    86 # define DEFAULT_LP CLP
    87   typedef ClpLp Lp;  
    88 #endif
    89 #endif
    90 
    91 } //namespace lemon
    92 
    93 #endif //LEMON_LP_H