One powerful feature of constraint programming is that variables can be used as subscripts for the terms in the objective function. For example, consider the following traveling salesman problem. The salesman needs to visit each of n cities (city 1, 2, . . . , n) exactly once, starting in city 1 (his home city) and returning to city 1 after completing the tour. Let cij be the distance from city i to city j for i j = 1, 2, . . . , n (i Ă˘â€°Â j). The objective is to determine which route to follow so as to minimize the total distance of the tour. (As discussed further in Chap. 14, this traveling salesman problem is a famous classic OR problem with many applications that have nothing to do with salesmen.)
Ă‚Â Letting the decision variable xj (j 1, 2, . . . , n, n 1) denote the jth city visited by the salesman, where x1 = 1 and xn+1 + 1, constraint programming allows writing the objective as
Save your time - order a paper!
Get your paper written from scratch within the tight deadline. Our service is a reliable solution to all your troubles. Place an order on any task and we will take care of it. You wonâ€™t have to worry about the quality and deadlinesOrder Paper Now
Using this objective function, formulate a complete constraint programming model for this problem.