Skip to main content
Admissions guidance, study banks, and career tools — get started on Shalyam

Travelling Salesman (Minimum Tour Cost)

Hard Bitmask DP

Given the cost matrix of travelling between n cities, print the minimum cost of a tour that starts at city 0, visits every city exactly once and returns to city 0.

Constraints

2 <= n <= 16 1 <= cost <= 10^4 (diagonal is 0)

Discussion

No discussions yet.

Rewards · v2.1

Get Exclusive Insights with Every Issue

Join Shalyam Newsletter

Stay ahead in education, research, and innovation—straight to your inbox.