noxy19 / TSP-Heuristic

Implementing the heuristic Lin Kernighan for the TSP, with CPU and GPU
1 stars 1 forks source link

project status #1

Open zkybs opened 7 years ago

zkybs commented 7 years ago

i have a question. Do you have finish this project? thanks!

noxy19 commented 7 years ago

No mate it's still on development, do you need help with something?

zkybs commented 7 years ago

No, I want to develop my project base on lk ,but have'nt find right lk project.

noxy19 commented 7 years ago

Well, you can use the function from lin_kern.h: void heuristic_lin_kernighan(VP(int)& best_solution, MATRIX(double)& TSP);

Parameters are:

Definitions:

define MATRIX(T) vector<vector >

#define VP(T) vector<pair<T, T> >

To create the matrix I have a function in tsp_read.h: void generateMatrix(VP(double)& cities, MATRIX(double)& TSP); Given a VP with the positions X Y of the city, and an empty MATRIX (but with the size of the n·n, where n is the number of cities), it will refill the TSP with the distance for every node.

Don't know if this helps in your project. The ln is working, even so I will try to improve it, to get better results.

zkybs commented 7 years ago

I'll try it. thank you very much!