Skip to content

Python scripts that tackle classic NP problems like the Traveling Salesman and 0/1 Knapsack using basic algorithmic approaches.

Notifications You must be signed in to change notification settings

Arts-HCS/np-problem-solvers

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

NP Problem Solvers in Python

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.


Contents

  • 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.

What Are NP Problems?

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.


How to Run

Clone the repository:

git clone https://github.com/Arts-HCS/np-problem-solvers.git
cd np-problem-solvers

About

Python scripts that tackle classic NP problems like the Traveling Salesman and 0/1 Knapsack using basic algorithmic approaches.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages