在coursera上学习discrete optimization时关于constraint programming的笔记整理

谁都会走 提交于 2020-02-06 15:23:41

Constraint programming

https://www.coursera.org/learn/discrete-optimization

General introduction

Constraint programming is an optimization technique that emerged from the field of artificial intelligence. It is characterized by two key ideas: To express the optimization problem at a high level to reveal its structure and to use constraints to reduce the search space by removing, from the variable domains, values that cannot appear in solutions.

Computation paradigm:

  1. Use constraint to reduce the set of values that each variable can take.
  2. Make a choice when no deduction can be performed. (assign a value to a variable)
  3. Choices can be wrong. Then the solver backtracks, tries another value.

Branch and prune:
Branch: decompose the problem into subproblem and explore the subproblems. (try all possible values of a variable until a solution is found or it can be proved that no solution exists.)
Prune: reduce the search space as much as possible. Use constraints to remove, from the variable domains, value that cannot belong to any solution.

A constraint just does two things:

  1. Feasibility checking. A constraint checks if it can be satisfied given the values in the domains of its variables.
  2. Pruning. If satisfiable, a constraint determines which values in the domains cannot be part of any solution.

The propagation engine(pseudocode)
def propagate ()
repeat until no constraint can remove any value from the domain of its variable
select a constraint c
if c is infeasible
return False
else
prune ()
return True

global constraint:
Sometimes if you take the constraints one by one to check feasibility, it will lose some information. Because the constraints are not independent, so global constraint help you to consider all the constraints at the same time and make it earlier to prune the infeasibility.

Optimize:
Impose a constraint that the next solution must be better.
Symmetric breaking constraint:
-impose an ordering on the variables
-impose a lexicographic constraint

Redundant constraint:
Motivation: they do not exclude any solution, but they reduce the search space. They express the properties not captured by the model.
-boost the propagation of other constraints
-provide a more global view
-combine existing constraint

Dual modeling:
Sometimes there are multiple ways to modeling the problem. And the two models may have complementary strengths. Some constraints are easier to express in one model and other in another one. Dual modeling is the idea of stating multiple models of a problem and linking them with constraints.

First-fail principle
Try first where you are most likely to fail. Do not spend time doing easy stuff first and avoid redoing the difficult part.

Variable-value labeling:

  1. Choose the variable to assign
  2. Choose the value to assign
    -first fail principle: choose the variable with smallest domain
    -reconsider the selection of the variable after each choice(the variable ordering is dynamic)
    -value ordering: often choose a value that leaves as many options as possible to the other variables

Value-variable labeling:

  1. Choose the value to assign
  2. Choose the variable to assign
    -you may know that value must be assigned
    -often the case in scheduling and resource allocation problems

Domain splitting
Sometimes assign a value to a variable is too strong(too arbitrary). so, we can split the domain of the value into two parts and decide which part should we choose. It is a much weaker commitment.

Randomization and restarts
Sometimes it is not obvious ordering. The key idea of randomization is to try a random ordering and if no solution is found after some limit(e.g. limit searching time), restart the search.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!