This repository contains basic Python implementations of well-known NP problems, including the Traveling Salesman Problem (TSP) and the 0/1 Knapsack Problem. The focus is on educational clarity and running simple test cases through a main.py file.
TSP.py– Solves the Traveling Salesman Problem with a simple brute-force approach.backpack.py– Solves the 0/1 Knapsack Problem using basic recursion or dynamic programming.main.py– Runs both solvers with sample inputs.
NP problems (nondeterministic polynomial time) are a class of computational problems that are difficult to solve efficiently but easy to verify. This repo serves as a lightweight playground to explore how these problems behave when implemented in Python.
Clone the repository:
git clone https://github.com/Arts-HCS/np-problem-solvers.git
cd np-problem-solvers