Skip to content

Instantly share code, notes, and snippets.

@engmonsh
engmonsh / gist:5231428
Last active December 15, 2015 08:29
The Dynamic Programming Algorithm for the Travelling Salesman Problem
/**
* Returns the order to visit predefined products of certain store in minimal distance
* which returns the sequence number to visit these products
*
* @author Ayman Mahgoub
*
*/
public class TravellingSalesMan {
private double[][] distances;
private short minDistances[][], paths[][];