Closed Kumar-laxmi closed 1 year ago
@Kumar-laxmi I would like to work on this issue. Please assign it to me
Hey @Kumar-laxmi I can solve this issue in Python, Java, and C++. Please assign this issue to me under SSOC'23
Assigned!
@saikiranreddy201 : Java & Python
I would like to work on this issue in java. Please assign it to me
i would like to work on this issuue in java , please assign this to me .
Is your feature request related to a problem? Please describe. The traveling salesman problems abide by a salesman and a set of cities. The salesman has to visit every one of the cities starting from a certain one (e.g., the hometown) and to return to the same city. The challenge of the problem is that the traveling salesman needs to minimize the total length of the trip.
Suppose the cities are x1 x2..... xn where cost cij denotes the cost of travelling from city xi to xj. The travelling salesperson problem is to find a route starting and ending at x1 that will take in all cities with the minimum cost.
Describe the solution you'd like Let the given set of vertices be {1, 2, 3, 4,….n}. Let us consider 1 as starting and ending point of output. For every other vertex I (other than 1), we find the minimum cost path with 1 as the starting point, I as the ending point, and all vertices appearing exactly once. Let the cost of this path cost (i), and the cost of the corresponding Cycle would cost (i) + dist(i, 1) where dist(i, 1) is the distance from I to 1. Finally, we return the minimum of all [cost(i) + dist(i, 1)] values.
Additional context