Before reading, it is a MUST that you have worked with VRP problems before and meta-heuristics algorithms:
i need to create an algorithm solving a classical VRP problem using Iterated local search algorithm with capacity and distance constraints only.
The algorithm should be structured as follow:
• Data “functions”
Initial solution file
• Containing the functions of initial solution as in the example algorithm
Main source file
• Move function
• Evaluation function
• Read from data file
Output File (separate file)
• Computer used
• CPU time in seconds
• Total time
• Total distance
• Number of iterations
• Number of iterations until best solution
• For each route:
Route free capacity (i.e. the remaining unutilized capacity in each route)
Another points to consider while programming:
1- Give meaningful names to the variables and the functions.
2 – Put comments in the most complex blocks of instructions and functions.
3 – Make a test for each function after writing it, because it is much easier to find an error in a single function than in a set of many functions, after finishing the program.
4 – Verify the input of the data.
5 – Test the solution. For example, in the program attached, the function Verify_route() verifies if the travelling time and the load is correct, and inside the function Print_solution() it is verified if each customer appears just once in the solution.
There is an example for the structure to follow in the attachments.
the data file to be used for solving the problem are attached as well.