문제

I wrote this infeasible oml by mistake while trying to do another thing. What's wrong about it is that the constraint at the bottom is impossible since the minimum value on the right must be zero and the maximum on the left must be bigger than zero (unless of course I'm missing something).

The problem is that if you run it MSF will happily give you an answer instead of telling you is infeasible.

string oml = @"
    Model[
        Decisions[Integers[0,Infinity], d1],
        Decisions[Integers[0,Infinity], d2],
        Decisions[Integers[0,Infinity], d3],
        Decisions[Integers[0,Infinity], d4],
        Decisions[Integers[0,Infinity], d5],
        Decisions[Integers[0,Infinity], d6],
        Decisions[Integers[0,Infinity], d7],
        Decisions[Integers[0,Infinity], d8],
        Decisions[Integers[0,Infinity], d9], 
        Decisions[Integers[0,Infinity], d10],
        Decisions[Integers[0,Infinity], d11],
        Decisions[Integers[0,Infinity], d12],
        Decisions[Integers[0,Infinity], d13],
        Decisions[Integers[0,Infinity], d14],
        Decisions[Integers[0,Infinity], d15],
        Decisions[Integers[0,Infinity], d16],
        Constraints[d1 + d2 + d3 + d4 + d5 + d6 + d7 + d8 == 2],
        Constraints[d9 + d10 + d11 + d12 + d13 + d14 + d15 + d16 == 2],
        Constraints[d1 + d9 <= 1],
        Constraints[d2 + d10 <= 1],
        Constraints[d3 + d11 <= 1],
        Constraints[d4 + d12 <= 1],
        Constraints[d5 + d13 <= 1],
        Constraints[d6 + d14 <= 1],
        Constraints[d7 + d15 <= 1],
        Constraints[d8 + d16 <= 1],
        Constraints[Max[d1 * 1, d2 * 2, d3 * 3, d4 * 4, d5 * 1, d6 * 2, d7 * 3, d8 * 4] <= Min[d9 * 1, d10 * 2, d11 * 3, d12 * 4, d13 * 1, d14 * 2, d15 * 3, d16 * 4]]
    ]
";

SolverContext sc = SolverContext.GetContext();
sc.LoadModel(FileFormat.OML, new StringReader(oml));
var sol = sc.Solve();
Console.WriteLine(sol.GetReport());

Edit:

This is what my report gives me:

===Solver Foundation Service Report===
Date: 6/26/2012 11:00:55 AM
Version: Microsoft Solver Foundation 3.0.1.10599 Express Edition
Model Name: DefaultModel
Capabilities Applied: CP
Solve Time (ms): 135
Total Time (ms): 338
Solve Completion Status: Feasible
Solver Selected: Microsoft.SolverFoundation.Solvers.ConstraintSystem
Directives:
Microsoft.SolverFoundation.Services.Directive
Algorithm: TreeSearch
Variable Selection: DomainOverWeightedDegree
Value Selection: ForwardOrder
Move Selection: Any
Backtrack Count: 0
===Solution Details===
Goals:

Decisions:
d1: 0
d2: 0
d3: 0
d4: 0
d5: 0
d6: 0
d7: 1
d8: 1
d9: 0
d10: 0
d11: 1
d12: 1
d13: 0
d14: 0
d15: 0
d16: 0
도움이 되었습니까?

해결책

It seems to be a version problem. When running the same problem in the latest release (standard edition) of MSF, the solver reports the problem as Infeasible. Apart from this, the report lists the same properties as the report from 3.0 above, just not the decision values.

So yes, it seems like there is some kind of bug in MSF 3.0. To overcome this bug, try and upgrade to the latest MSF version, 3.1.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top