retagged by
5,073 views
1 votes
1 votes

A)250    B)300      C)550      D)375

retagged by

2 Answers

1 votes
1 votes
The answer is 375 , a-b-c-d-e

 We basically brute force search through all possible paths and pick the cheapest one , in this case its 375.
0 votes
0 votes
This can be done by brute force but no of path will be (n-1)!/2. From the choose the path of minimum length.

Else you can apply Floyed warshall Algortihm to calculate the path cost taken by the salesman. Which turn out to be 375.

 

Note : Here I read few of the comment which were saying that Kruskal or Primis can be applied to calulate the TSP  but it is wrong as we all know that Kruskal and Prims create a Minimum Spanning Tree(Not path, Tree can have branches where we are finding optimal path for n-1 vertex and adding our starting vertex and the start and end to create a cycle.)
edited by

Related questions

0 votes
0 votes
0 answers
1
0 votes
0 votes
1 answer
2
0 votes
0 votes
2 answers
3
priyanka gautam-piya asked Dec 15, 2016
2,749 views
Question - 14 question is what is the approch to solve it by dynamic programming ?