[Symphony] Questions about multi-objective optimization

Christopher Wilcox wilcox at cs.colostate.edu
Wed Oct 26 19:18:04 EDT 2011


I just picked up Symphony 5.4.0 and started to use the C interface.  I
copied the milp2.c program and changed it to do multi-objective
optimization. The code and output is attached, including the AMPL
description I started with. The problem I coded is a variant of the Knapsack
problem, in which we try to optimize the value of boxes put into a knapsack.
The original problem has boxes with weights and values, and we try to
maximize value within a weight constraint. This works fine as a
single-objective problem in Symphony. I modified the program to add volume
to the boxes, now I try to maximize value and weight within a volume
constraint. When I look at the output I see three answers before the program
fails, as follows:

DATA          BOX        WEIGHT      VALUE     VOLUME
              Green        8           4         3
              Gray         1           1         4
              Yellow       4          10         5
              Orange       3           2         1
              Blue         1           2         1

CONSTRAINT: Sum of volumes < 15
MAXIMIZE:   Sum of values
MAXIMIZE:   Sum of weights

SOLUTIONS:

3 Yellow + 3 Orange: Value = 36, Weight = 21, Volume = 15
15 Orange: Value = 30, Weight = 45, Volume = 15
1 Yellow + 11 Orange: Value = 32, Weight = 37, Volume = 15

Here are my questions:

1) The above solutions only show up in the output, how do I retrieve them?
With sym_get_col_solution()?
2) How many solutions should I expect?
3) How does the weighting function sym_set_obj2_coeff affect the result? Is
the first objective more important?
4) Can I write this same program in C++? Is there an example similar to
milp2.c in C++?
5) Why is my program crashing with a malloc error? Do I need to ask for more
resources on the command line?

-Chris-

cgwilcox at gmail.com
wilcox at cs.colostate.edu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://list.coin-or.org/pipermail/symphony/attachments/20111026/a592702b/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: knapsack.c
Type: text/x-csrc
Size: 4011 bytes
Desc: not available
URL: <http://list.coin-or.org/pipermail/symphony/attachments/20111026/a592702b/attachment-0002.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: knapsack.log
Type: text/x-log
Size: 13049 bytes
Desc: not available
URL: <http://list.coin-or.org/pipermail/symphony/attachments/20111026/a592702b/attachment-0003.bin>


More information about the Symphony mailing list