I believe that should be C <= 0.
> | C <= 10 = 7 + 10 C
> | otherwise = no solution
>
> I finally managed to get some solution using the bigparm trick, but it
> is not quite what I'd expected: despite of requesting an integer
> solution, the objective value is only integral for certain values of
> the parameter.
What does the output look like and why do you say that the output
is non-integral? Note that PIP assumes that the parameters are
integeral. Perhaps that explains your confusion?
skimo
And that's what you get:
38 + 31 * ((5 * 9)/10) - 21 * 5 = 38 + 31 * 4 - 21 * 5 = 57
> I'm not actually confused, I hope, but maybe I misunderstood PiPs
> output:
> (()
> (if #[ 0 -1 10]
> (newparm 2 (div #[ 0 9 0] 10))
> (list #[ 1 21 -31 -38]
> #[ 1 1 -1 -1]
> #[ 1 -1 1 0])
> ()
> ))
> which, after removing the big paramter translation (x ==> B - x)
> corresponds to
> if C <= 10
> let ?2 = 9/10 C
No, ?2 = (9 * C)/10
> obj = 38 + 31 ?2 - 21 C = 38 + 69/10 C
integer division is not a linear operation.
> > Note that PIP assumes that the parameters are integeral. Perhaps that explains your confusion?
> So the 'integral' mode assumes integral parameters, but still allows
> for rational objective values (respectively rational solutions to
> unknowns)?
No, parameters are always integral. Unknows are rational is rational mode.
> I'm also curious, in case anyone cares to explain, why PiP cannot find
> a satisfactory solution for the second problem.
No idea. I no longer support piplib.
In isl, you get essentially the same answer in both cases:
lexmax [C] -> {[obj,a,b] : obj <= 38 a + 7 b + 10 C and a+b <= 1 and C <= 10 b and a,b,C >= 0};
[C] -> { [obj, a, b] : 31a = -7 - 10C + obj and 31b = 38 + 10C - obj and C >= 0 and C <= 10 and 10obj <= 380 + 69C and 10obj >= 101 + 69C }
lexmax [C] -> {[obj,a,b,c] : obj <= 38 a + 7 b + 10 c and a+b <= 1 and C <= 10 b and c <= C and a,b,c,C >= 0};
[C] -> { [obj, a, b, c] : 31a = -7 - 10C + obj and 31b = 38 + 10C - obj and c = C and C >= 0 and C <= 10 and 10obj <= 380 + 69C and 10obj >= 101 + 69C }
skimo
Right,
lexmax [C] -> {[obj,a,b,c] : obj <= 38 a + 7 b + 10 c and a+b <= 1 and c <= 10 b and c <= C and a,b,c,C >= 0};
[C] -> { [obj, a, b, c] : (obj = 7 + 10C and a = 0 and b = 1 and c = C and C >= 5 and C <= 6) or (exists (e0 = [(9C)/10], e1 = [(-47 + obj + 9a + 20e0)/30]: b = 1 - a and 10c = -7 + obj - 31a and C >= 0 and C <= 10 and 10e0 <= 9C and 10e0 >= -9 + 9C and 20e0 >= -141 + 3obj + 27a and 20e0 <= -121 + 3obj + 27a and 30e1 <= -47 + obj + 9a + 20e0 and 30e1 >= -67 + obj + 9a + 20e0 and 15e1 >= -94 + 2obj + 18a and 10e1 >= -27 + obj - 11a and 10e1 <= -17 + obj - 11a and 69a <= 107 - obj)) or (C = 4 and obj = 47 and a = 0 and b = 1 and c = 4) or (a = -7 - 10C + obj and b = 8 + 10C - obj and c = 21 + 31C - 3obj and 4obj >= 35 + 39C and 8obj <= 78 + 77C and C <= 10 and obj >= 7 + 10C and 3obj <= 28 + 29C and 7obj <= 59 + 69C and obj <= 8 + 10C) or (obj = 107 and a = 0 and b = 1 and c = 10 and C >= 11) }
> This is hopefully the problem I had in mind originally, with the
> solution (0<=C<4 ==> 38, 4<=C<=10 ==> 7 + 10 C)
Looks like it, except that there's also a C >= 11 case.
I should tell you, though, that your example uncovered a bug in isl,
so you'll only get the answer above is you use the very latest version
of isl.
skimo