wiki:Example/Building/acro-pico

Example: Building acro-pico

Downloading

The Acro-pico project can be checked out using subversion:

svn checkout https://software.sandia.gov/svn/public/acro/acro-pico/trunk acro-pico

Alternatively, the svn.a script can be used to checkout the acro-pico project as follows:

svn.a checkout acro-pico

See the subversion documentation for further detail about using svn more directly. The Acro subversion repository supports anonymous checkouts, so you will not need a password for this command.

Configuring and Building

Acro can be configured using the standard build syntax:

cd acro-pico
./setup
autoreconf -i -f     (Only required if acro-pico was checked out with svn)
./configure
make

This builds the PICO command in acro-pico/bin, along with supporting libraries. The setup command bootstraps the configuration process with files from the bootstrap directory. This command also supports an alternate configure/build mechanism that archives and analyzes the output of this process.

Executing the PICO Solver

The PICO MILP solver can be launched directly within a Unix shell command line, or indirectly from within the AMPL solver interface. To illustrate the use of the PICO MILP solver, we will consider the following simple integer program:

TODO: math here

SC is a simple example of a set-cover application, with three sets.

Using PICO within AMPL

SC is formulated as an AMPL model in  SC.mod. Within a UNIX shell, AMPL can be used to process the file SC.mod as follows:

$ ampl
ampl: model SC.mod;
ampl: option solver PICO;
ampl: solve;
PICO Solver Library 1.0:

Final Solution:  Value = 2

Subproblems
-----------
Created            3  100.0%
Started Bounding   2   66.7%
Bounded            2   66.7%
Started Splitting  1   33.3%
Split              1   33.3%
Dead               0    0.0%


Search Time: 0.0 seconds
Total  Time: 0.0 seconds
gss: return code 0; final f = 2
ampl: exit;

Note that the PICO executable must be in your search path in this example.

Using PICO Directly

Although it is quite convient to formulate and solve applications within environments like AMPL, there are many case where it is necessary to apply a MILP solver directly. For example, AMPL is a commercial code that may not be available. Also, it is not currently possible to launch parallel solvers from AMPL, so its use with PICO is limited to serial solvers. Three different file formats are supported when running PICO directly:

  • The GNU MathProg format
  • The MPS format
  • The CPLEX LP format

The commandline syntax for executing PICO with these input formats is

   PICO {--parameter=value ...} <MPS-file>
   PICO {--parameter=value ...} <LP-file>
   PICO {--parameter=value ...} <AMPL-model-file> <AMPL-data-file>

The --help parameter option can be used to display all available parameters for the PICO solver. By default, PICO applies the CLP linear programming solver, although the SOPLEX, GLPK and CPLEX linear programming solvers can also be used.

The GNU MathProg format closely resembles the format of the AMPL modelling language. Significant differences are that MathProg does not support nonlinear expressions (e.g. functions like log), and its parser can be picky about the existence of white space around tokens in an expression. In the case of SC, the MathProg format exactly matches the AMPL format, so we can directly apply PICO as follows:

    PICO SC.mod

The MPS format was originally introduced by IBM to express linear and integer programs in a standard way. The format is a fixed column format, so care must be taken that all information is placed in the correct columns as described below. The  SC.mps file illustrates the MPS representation of the SC problem, and we can directly apply PICO as follows:

    PICO SC.mps

Finally, the CPLEX LP format represents linear constraints and objectives with a simple syntax. This syntax is similar to a subset of the AMPL syntax, omitting nonlinear expressions and set notation. The  SC.lp file illustrates the LP format for the SC problem, and we can directly apply PICO as follows:

    PICO SC.lp