You are on page 1of 2

ECE457A, 2011

Cooperative and Adaptive Algorithms

Assignment 2: Simulated Annealing


(Due Date: June 6, 2011- 5pm)
What to hand in: a report that contains: The solution for the problems, typed or neatly handwritten The simulation results for the second problem, Any written code that is used to generate the provided results.

1. [40 marks] Simulated Annealing can be used to solve The Vehicle Routing Problem (VPR) defined by having m vehicles at a depot that need to service customers in c cities. The travel distances between every two cities are defined by a matrix D with element dij denoting distance between cities i and j. The travel distances from the depot to each of the cities are given by a vector Depot. Each customer j has a service time sj The VPR consists of determining the routes to be taken by a set of m vehicles satisfying the following conditions: Starting and ending at the depot, Having minimum cost (travel+service), Each customer is visited exactly once by exactly one vehicle. The figure below illustrate possible routes for a 9 customers and 3 vehicles problem

9 8

2 Depot

4 3 5 7 a) Assuming that the number of required routes is fixed and that its equal to the number of vehicles. Simulated Annealing could be applied in order to solve this problem, its required to: i. Find a suitable solution representation (10 marks), ii. Define a suitable neighborhood operator (15 marks), iii. Define the objective function used to calculate the cost of a solution (10 marks). b) How would the problem formulation change if we add the constraint that the total duration of any route shouldnt exceed a preset bound T? (5 marks)

ECE457A, 2011

Cooperative and Adaptive Algorithms

2. [60 marks] Capacitated VRP (CVRP) is a variant of VRP where each of the customers has specific demand for a commodity and each of the vehicles has a specific capacity to transport the commodity. The objective here is to find the minimum number of vehicles that (as in the VRP problem) minimizes the travel and service time as well as satisfying the customer demand and not exceeding the vehicles capacities. a) Discuss the changes that you need to do to your formulation of problem 1 to address this variant of the VRP. (5 marks) b) Coding and experiment
Given a simulated annealing implementation in Matlab, adapt the code to the CVRP problem by introducing proper initial solution generator, cost evaluation function and random neighbor generator (20 marks). ii) Run the code 5 times for each given instance of A1 and A2 with an initial temperature of 100, number of iterations per temperature of 500, a geometric temperature decreasing rate of 0.95, and final temperatures of 0.001 and 0.00001 for the first and second problem, respectively. Report and comment on your results (20 marks). c) Problem search space i)

The problem search space is defined as the set (space) containing all the possible solutions (points) that could be evaluated (sampled) by a search algorithm during the run. As the search algorithm evaluates more solutions (covering bigger areas of the search space) it will have a higher probability of reaching better solutions. i) What is the maximum number of points (solutions) that SA samples (evaluates) in the search space if the initial temperature is set to 100 and a final temperature of 0.001 with 500 iterations per temperature are set and the geometric temperature decrement rate of =0.95 is used (find this value analytically)? (10 marks) ii) Modify your code that counts the search space and verify your answer of above. (5 marks) The provided test cases and functions are as: (1) 2 instance CVRP problems: A1.mat, A2.mat. The file structure is as follows: ProblemData_Ax{1}: number of trucks ProblemData_Ax{2}: number of customers ProblemData_Ax{3}: capacity of the trucks ProblemData_Ax{4}: position of the customers ProblemData_Ax{5}: demand of the customers (2) A simulated annealing implementation in Matlab (SACVRP.m). In this function, CVRPneighborGen function generates a neighbor solution randomly, and costFCN calculates the cost of each solution. You are required to code these two functions, along with the initial solution generator are (part b) i)

You might also like