Resources of the page:
In the last decade Constraint Programming (CP) has shown its effectiveness in modeling and solving real-world combinatorial optimization problems. CP is a programming paradigm exploiting Constraint Satisfaction techniques ([4]), and in the following we restrict our attention to CP on Finite Domains (CP(FD)) which is the case of all constraint tools for discrete optimization such as CHIP ([1]), Ilog Solver ([7]), Eclipse ([6]), cc(FD) ([8]), CHOCO ([3]), etc. The next paragraph briefly introduces the CP terminology that will be used in the remainder of the chapter. Complete definitions can be found in [5] (a complete textbook), and [2] (a basic introduction). Combinatorial optimization problems are modeled through CP(FD) by means of a set of variables taking their value on a finite domain of integers, and are linked by a set of constraints. The constraints can be of mathematical or symbolic type, and in this second case, when they refer to a set of variables, are referred to as global constraints. Global constraints typically model a well-defined part of the overall problem, where well-defined means that the same part has been recognized as a subproblem in several cases. A classic example of global constraint is the all_different(x_{1}, ...,x_{n}) constraint which imposes that variables x_{1}, ..., x_{n} must assume different values in a feasible solution. To each constraint is associated a propagation algorithm aimed at deleting from variable domains the values that cannot lead to feasible solutions. Constraints interact through shared variables, i.e., as soon as a constraint has been propagated (no more values can be eliminated), and at least a value has been eliminated from the domain of a variable, say v, then the propagation algorithms of all the other constraints involving v are triggered ([4]). Propagation algorithms are usually incomplete: once propagation is finished, there may remain some inconsistent values in the variable domains^{1}. Therefore, unless the propagation phase ends with a fully instantiated solution or a failure (proving the problem inconsistent), a search phase is executed. One branching step is performed by partitioning the current problem (or the subproblem) into (easier) subproblems, e.g., by instantiating a variable to a feasible value in its domain. Propagation and search are interleaved in order to reach one or all feasible solutions. As soon as a feasible solution improving the current best one is found, CP systems add a new constraint to the remaining search tree stating that further solutions should have a better value. This new constraint excludes leaf nodes from the remainder of the tree having a cost which is worse than the current one. Thus, CP solves a sequence of feasibility problems that improve the value of the objective function. It is not difficult to see that the main advantage of using CP systems is flexibility: CP supports the design of declarative, compact and flexible models where the addition of new constraints is straightforward and does not affect the previous model. Indeed, the propagation of the previous constraints remain unchanged (since they locally model parts of the overall problem), and the previous constraints simply interact with the new ones through shared variables.
The Traveling Salesman Problem with Time Windows (TSPTW) is the problem of finding a minimum-cost path visiting a set of cities exactly once, where each city must be visited within a specific time window. We propose a hybrid approach for solving the TSPTW that merges Constraint Programming propagation algorithms for the feasibility viewpoint (find a path), and Operations Research techniques for coping with the optimization perspective (find the best path). We show with extensive computational results that the synergy between Operations Research optimization techniques embedded in global constraints, and Constraint Programming constraint solving techniques, makes the resulting framework effective in the TSPTW context also if these results are compared with state-of-the-art algorithms from the literature.
^{1}Note that in the general case forcing acr consistency even for a single constraint is NP-hard.
C++ code