[SCIP] Coding in ZIMPL regarding
Gregor Hendel
hendel at zib.de
Sat Jan 21 13:08:07 CET 2017
Dear Shahul,
I will try to answer your questions one by one inline. For some of them,
I guess I will need some additional information in order to thoroughly
understand the issue.
Am 20.01.2017 um 07:58 schrieb Shahul Hameed K K:
> Dear sir,
> Your suggestion was perfect for me and I have coded further, Thank you!
>
> When I analysed over some examples, I have got the following queries regarding ZIMPL;
>
> 1. Is there tuples available in ZIMPL? i.e can I group the related data together?
> e.g, something like
> tuple TRIPS {
> int tripID;
> int startTime;
> int endTime;
> }
>
> To achieve this in ZIMPL, I have declared like below;
> Set TRIPS:= {},then
> tripID[TRIPS]:=
> startTime[TRIPS]:=
> endTime[TRIPS]:=
>
> So I would like to ask you if I have done it in the correct way or is there any advanced techniques available?
I would use your approach, too. Zimpl is a mathematical modelling
language that basically uses sets and parameters, no grouping or any
other advanced form of data management.
>
> 2. In some of the trials, even though I have declared the variable as binary, it only gives me LP optimal solution, not the MILP solution. Why is it so?
> By declaring the variable as binary, I would like to see MILP solution which is only meaningful to me.
> Why is that happening and what should be done to obtain the MILP solution?
Here, my question is basically: What is the "it" that gives you the
unexpected answer? What commands do you use to run your models?
>
> 3. To check the values of some of the parameters, I used the ' do print' statements. But I could not view those parameters and values both in the Log window and messages window. I would like to ask you where can I view the print statements?
Which log and messages window? Are you using some Integrated Development
Environment? Zimpl is a command-line tool that will output the prints
when invoked from a command line such as a Linux-Terminal or a windows
Bash (although I haven't used it under windows so far).
>
> 4. When I declare a parameter, say,
> param Cost[TTA]:= read "cost.txt" as "<1n,2n,3n> 4n";
> like this, can I initialize it to a value say, 1000 so that whenever it does not get a tuple from the text file, it initializes cost for that tuple automatically to 1000.
Use the default keyword as explained in the Parameters section of the
ZIMPL documentation.
>
> 5. other than the text file, what are the other file types which I can use in ZIMPL for reading data? Can I read the data from databases? Can I perform post processing to print the solution(values of the variables and parameters)?
I think the answer is None, unfortunately. In order to build models from
database data, you would need to use the SCIP API to create your model.
Alternatively, you can query the data beforehand and produce a txt-File
that ZIMPL can understand.
>
> 6. Finally, I would like to ask you that, like in many of the commercial solvers, is there techniques available to make an infeasible problems feasible by relaxing some of the constraints and so on..Is there any advanced techniques available?
For starters, you can use SCIPs command "change minuc" after reading in
a problem like so:
read check/instances/MIP/stein27_inf.lp
change minuc
optimize
display solution
The last command will print out the following for the mentioned problem:
objective value: 1
...
objcut_master 1 (obj:1)
The command "change minuc" transforms the problem into a minimization
problem of the number of constraints that cannot be satisfied. In this
case the constraint named "objcut" cannot be satisfied simultaneously
with the other constraints. And indeed, dropping the used objective
cutoff (which is the reason that this model is infeasible) gives a
feasible model with an optimal objective value of 18 (see
check/instances/MIP/stein27.fzn, from which the above, infeasible
instance was derived by adding an artificial objective cutoff of 16 or so).
Have a nice weekend,
Gregor
More information about the Scip
mailing list