[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Help-glpk] Controlling glpsol output
From: |
Brady Hunsaker |
Subject: |
Re: [Help-glpk] Controlling glpsol output |
Date: |
19 Feb 2004 20:22:41 -0500 |
On Mon, 2004-02-16 at 08:06, Pieter Thysebaert wrote:
>
>
> Hello all,
>
> I'm using glpk 4.2 and am trying to use the standalone solver "glpsol"
>
> THe problem i'm solving is a MIP.
>
> For each real-world entity, the decision process must decide on a set of
> binary variables (i.e. set them to 0 or 1).
>
> Most of these sets must obey a "sum = 1" constraint.
>
> Obviously,
> 1. Most variables are 0 and only a few are 1 in the solution
> 2. I can get all the info I need (read: I am only interested in...) the
> variables which are set to 1 in the solution
>
>
> When using "glpsol --model test.model --output test.output" I get the entire
> solution;
>
> Is there a way to control which variables are output?
>
> Or even better, is there a way to execute a display-like statement after the
> solution has been found, so that I can limit the output to whatever I want?
>
> Or do I really have to write an entrie parser for the complete output file in
> this case?
>
>
> Pieter
>
>
I think you have two choices:
1. Write a parser for the big output file, as you suggested.
2. Instead of using glpsol, write a small program. Appendix A of the
Language manual describes how to call the parser with the function
lpx_read_model to input your instance. Then call the solution function
(lpx_integer, I guess) and use lpx_mip_col_val to determine which
columns you want to display.
But there was a change in API for 4.4; it looks like you should use
lpx_get_mip_col if you're using 4.2.
Brady