4

I have an optimization problem that is subjected to linear constraints. How to know which method is better for modelling and solving the problem. I am generally asking about solving a problem as a satisfiability problem (SAT or SMT) vs. Solving as a linear programming problem (ILP OR MILP).

I don't have much knowledge in both. So, please simplify your answer if you have any.

MyStackRunnethOver
  • 4,872
  • 2
  • 28
  • 42
Rehab11
  • 483
  • 2
  • 7
  • 16
  • Could you describe your problem more clearly, please? "An optimization problem that is subjected to linear constraints" doesn't provide much meaningful info. Without it I fear there is no better answer to this question than "read up on what SAT and LPs/ILPs are" – MyStackRunnethOver Dec 01 '18 at 00:14
  • Depends on *a lot* of specifics. But the keywords *optimization* (instead of feasibility) and *linear constraints* pushes it slowly away from pure SAT. I see you used the tag constraint-programming. That's one more approach somewhat orthogonal to the others. – sascha Dec 01 '18 at 10:01
  • @MyStackRunnerOver I will give an example. I want to distribute the min. Possible number of sensor nodes over an area such that a certain level of quality is satisfied. By quality I mean a set of metrics such that coverage....etc. – Rehab11 Dec 01 '18 at 11:41
  • @sascha why is it pushed away from SAT? when I did some search I found constrint programming is mentioned. But it is not clear for me the difference between the 3 concepts: SMT, LP and constraint programming? And how to find out which one fits to which kind of problems? – Rehab11 Dec 01 '18 at 11:46
  • 1
    Because SAT is all about feasibility and optimization has a less evolved theory than e.g. available in ILP. Either you do some heavy research to grasp the differences or present your problem formally to get some recommendation. Explaining the differences between those concepts is not in the scope of StackOverflow. At lot of core-things are not even well understood. But in general: those approaches have different proof-systems and some problems really make it hard to be handled in some system.Simple example: `sum(x) <= 1` is very troublesome in SAT and research proposed many different encodings – sascha Dec 01 '18 at 12:33
  • What about SMT solvers that support optimization. Z3 for example. – Rehab11 Dec 01 '18 at 14:01
  • 1
    Still depends on the problem (everything is possible: from being awfully slow to very fast compared to SAT; imho: more often the former, but well... problem-dependent). Those are (usually) SAT(-based) solvers with additional proof-systems (e.g. cutting-planes), whose incorporation *sacrifices a lot* of SAT-solvers raw power. *Edit*: just saw that there is *some* informal problem-info in a comment (but not in the question): sounds more like a math-opt problem calling for MICP solvers (convex > linear; depending on your exact *metrics*; exploiting metrics is very important here!). – sascha Dec 01 '18 at 14:45
  • Some more simple [example problem](https://stackoverflow.com/a/47160114/2320035). – sascha Dec 01 '18 at 14:54

1 Answers1

4

Generally speaking, the difference is that SAT is only trying for feasible solutions, while ILP is trying to optimize something subject to constraints. I believe some ILP solvers actually use SAT solvers to get an initial feasible solution. The sensor array problem you describe in a comment is formulated as an ILP: "minimize this subject to that." A SAT version of that would instead pick a maximum acceptable number of sensors and use that as a constraint. Now, this is a satisfiability problem, but not one that's easily expressed in conjunctive normal form. I'd recommend using a solver with a theory of integers. My favorite is Z3.

However, before you give up on optimizing, you should try GMPL / GLPK. You might be surprised by how tractable your problem is. If you're not so lucky, turn it into a satisfiability problem and bring out Z3.

  • I am already trying to use z3. But what about optimization using Z3? It supports multi objective optimization as far as I know. In that case, what is the difference with LP? – Rehab11 Dec 04 '18 at 17:15
  • 1
    Multiobjective optimization with Z3 is going to be on the expensive side -- or rather, if your problem is hard enough that you need Z3, it's likely to be expensive to solve a multi-objective version of it. ILP solvers are resolutely single-objective, although if the feasibility problem is the same for each objective you can probably hook into the solver to keep track of all the feasible solutions you've found, and then Pareto sort them. – Matthew Woodruff Dec 04 '18 at 17:53