Lakhankumawat / LearnCPP

Learn Cpp from Beginner to Advanced ✅ Practice 🎯 Code 💻 Repeat 🔁 One step solution for c++ beginners and cp enthusiasts.
https://lakhankumawat.github.io/LearnCPP/
MIT License
598 stars 484 forks source link

TSP bitmasking program added #1549

Closed AbhijitDutta338 closed 2 years ago

AbhijitDutta338 commented 2 years ago

Related Issue

Proposed Changes

Additional Info

Checklist

Added a Travelling salesman solution using DP with bitmasking. Implemented a top-down DP approach that uses a DP Matrix with (2^N) *N dimensions with N being number of cities and 2^N is the total number of permutations of cities that are visted and yet to be visited.

Added a program for TSP with DP & bitmasking.

It is an implementation of TSP solution using DP & bitmasking. Previously, this repository contained an solution for TSP but lacked the bitmasking approach. This pull request aspires to add the same.

1548

https://github.com/Lakhankumawat/LearnCPP/issues/1548

I have used a sample adjacency matrix for testing whether the program is working properly

I used an online C++ compiler for testing my program -> https://www.onlinegdb.com/online_c++_compiler

It does not affect any other areas

Output Screenshots

Screenshot #1 Screenshot #2
test -1 test-2
image image
AbhijitDutta338 commented 2 years ago

Please review my PR @Lakhankumawat

github-actions[bot] commented 2 years ago

This PR is stale because it has been open 3 days with no activity. Please commit the changes requested or make improvements on the code. Thank you for your contributions!