A great lathe operator commands several times the wage of an average lathe operator, but a great writer of software code is worth 10,000 times the price of an average software writer. Bill Gates

Traveling salesman problem

Language Java | Level Intermediate | Category Algorithms | August 5, 2015 8:10 am


Algorithm Problem Description

Travelling salesman problem helps to find the shortest possible route that visits each city exactly once and returns to the origin city. The traveling salesman problem solves the given set of cities and distance between each pair of cities. Find the shortest route that visit each city exactly once and return to the origin of the city.

Write a program to give all the brute force approach to find the sorted path between the cities?

Output

          	        
          	        

Number of items from the list: [0, 1, 2]
All the routes using Branch and bound : 
[0, 1, 2]
[0, 2, 1]
[1, 2, 0]
[1, 0, 2]
[2, 0, 1]
[2, 1, 0]

          	        
          	        				    


Comments



Please login to add comments.