Skip to content

Latest commit

 

History

History
99 lines (61 loc) · 1.8 KB

README.md

File metadata and controls

99 lines (61 loc) · 1.8 KB

This repos contain some programs for solve CVRP (Capacitated Vehicle Routing Problem) specifically for "Collectors garbage trucks" using sweep algorithm and Tabu Search in C++ with C++11 standard.

table of contents

#sweep.cc sweep algorithm

This program recieve from standar input the number of nodes, after that read info of each node as follows:

r Θ C id

where:

r is the radial coordinate (double)

Θ is the angular coordinate (double)

C is the capacity of each node (for this problem is the weight of garbage) (double)

id is an unique id of each node.

the input info is on file sweep_input.

for compile

g++ sweep.cc -o sweep

for run

 ./sweep < sweep_input

for save solution of sweep algorithm as input of Tabu Search

./sweep < sweep_input > TS_init_sol_input

#TS.cc

This program requires these files:

demand: matriz with nodes demand (double)

costs: matriz with costs between all nodes (double)

TS_init_sol_input: init solution for algorithm

for compile:

g++ TS.cc -o TS -std=c++11

for run:

./TS < TS_init_sol_input

for run and save solution in file:

./TS < TS_init_sol_input > readSol_input

#readSol.cc

This program only show data solution more friendly so readSol.cc requires these files:

costs matriz of nodes costs

readSol_input output solution vector of TS.cc

demand matriz of nodes demand

tiempos.txt matriz of nodes times

for compile

g++ readSol.cc -o readSol

for run

./readSol < readSol_input

#runing example

for runing example execute run.sh in a terminal.