Skip to content

Instantly share code, notes, and snippets.

View nawedx's full-sized avatar
🏠
Working from home

Nawed Imroze nawedx

🏠
Working from home
  • Hyderabad, India
View GitHub Profile
@nawedx
nawedx / traveling_salesman.cpp
Last active April 3, 2018 10:28 — forked from jgcoded/traveling_salesman.cpp
Traveling Salesman solution in c++ - dynamic programming solution with O(n * 2^n).
#include <vector>
#include <iostream>
#include <limits.h>
using namespace std;
/**
\brief Given a complete, undirected, weighted graph in the form of an adjacency matrix,
returns the smallest tour that visits all nodes and starts and ends at the same
node. This dynamic programming solution runs in O(n * 2^n).