Constraint Programming page

Resources of the page:

1. A very brief introduction to Constraint Programming (Section 1).

2. C++ source code of a Traveling Salesman Problem constraint used in
F. Focacci, A. Lodi, M. Milano, "A hybrid exact algorithm for the TSPTW", INFORMS Journal on Computing 14, 403-417, 2002 (Section 2).

3. A list of pointers to CP references and CP tools (Section 3).

1  Introduction to CP

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 (), 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 (), Ilog Solver (), Eclipse (), cc(FD) (), CHOCO (), 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  (a complete textbook), and  (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(x1, ...,xn) constraint which imposes that variables x1, ..., xn 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 (). Propagation algorithms are usually incomplete: once propagation is finished, there may remain some inconsistent values in the variable domains1. 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.

2  Solving the TSP with Time Windows

Abstract:

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.

• Download the C++ code used to model the TSP constraint
The code was developed using ILOG Solver and Scheduler 4.4
send comments and questions to Filippo Focacci ffocacci@ilog.fr

References


A. Aggoun and N. Beldiceanu. Extending CHIP in order to solve complex scheduling and placement problems. In Actes des Journees Francophones de Programmation et Logique, Lille, France, 1992.

F. Focacci, A. Lodi, M. Milano, and D. Vigo. An introduction to constraint programming. Ricerca Operativa, 91:5-20, 2000.

F. Laburthe. CHOCO: implementing a CP kernel. In CP'00 Post Conference Workshop on Techniques for Implementing Constraint programming Systems - TRICS. Singapour, 2000.

A. Mackworth. Consistency in networks of relations. Artificial Intelligence, 8:99-118, 1977.

K. Marriott and P.J. Stuckey. Programming with Constraints. The MIT Press, 1998.

J. Schimpf, S. Novello, and H. Sakkout. IC-Parc ECLiPSe Library Manual, 1997.

Solver. ILOG Solver 5.0 User's Manual and Reference Manual. ILOG, S.A., 2000.

P. van Hentenryck, V. Saraswat, and Y. Deville. and evaluation of the constraint language cc(FD). Technical Report CS-93-02, Brown University, 1993.

Footnotes:

1Note that in the general case forcing acr consistency even for a single constraint is NP-hard.
{"ft_lang_label":"__label__en","ft_lang_prob":0.8869646,"math_prob":0.85106325,"size":5899,"snap":"2019-43-2019-47","text_gpt3_token_len":1296,"char_repetition_ratio":0.13011026,"word_repetition_ratio":0.004371585,"special_character_ratio":0.22020681,"punctuation_ratio":0.1425926,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.97090596,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2019-10-20T03:24:20Z\",\"WARC-Record-ID\":\"<urn:uuid:f681258b-dfd7-4b59-8bfa-b8a3ff305a75>\",\"Content-Length\":\"32819\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:a9f7e560-e4ca-4cc1-845b-69d34ea41c15>\",\"WARC-Concurrent-To\":\"<urn:uuid:ae041612-4625-4910-80ec-87e074f1b613>\",\"WARC-IP-Address\":\"137.204.144.36\",\"WARC-Target-URI\":\"http://or.dei.unibo.it/library/constraint-programming-page\",\"WARC-Payload-Digest\":\"sha1:NYMD5N4LXRYJ3OGJZAIEUH3BYHY2YN2L\",\"WARC-Block-Digest\":\"sha1:BSC6NBKKW5A6XLZ3RVJ2SLNEIU7BO2JY\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2019/CC-MAIN-2019-43/CC-MAIN-2019-43_segments_1570986702077.71_warc_CC-MAIN-20191020024805-20191020052305-00220.warc.gz\"}"}