Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/justin-pyne/combinatorics-projects
Three Python scripts demonstrating combinatorics through permutations, combinations, and the Traveling Salesman Problem (TSP) solution using permutations.
https://github.com/justin-pyne/combinatorics-projects
Last synced: 6 days ago
JSON representation
Three Python scripts demonstrating combinatorics through permutations, combinations, and the Traveling Salesman Problem (TSP) solution using permutations.
- Host: GitHub
- URL: https://github.com/justin-pyne/combinatorics-projects
- Owner: justin-pyne
- Created: 2023-11-01T18:46:23.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2023-11-01T19:56:48.000Z (about 1 year ago)
- Last Synced: 2023-11-01T20:33:41.763Z (about 1 year ago)
- Language: Python
- Homepage:
- Size: 1000 Bytes
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Combinatorics Projects
This repository contains three Python scripts that explore different aspects of combinatorics:
1. `generate_visualize_permutations.py`:
- Generates all possible permutations of a given list of elements.
- Visualizes each permutation as a series of colored blocks, where each color represents a different element.2. `generate_visualize_combinations.py`:
- Generates all possible combinations of a given list of elements.
- Visualizes each combination as a series of colored blocks, where each color represents a different element.3. `TSP_permutation_visualization.py`:
- Solves the Traveling Salesman Problem (TSP) using a brute force approach that explores all possible permutations of cities.
- Visualizes the cities on a scatter plot and the distances between them in a distance matrix.
- Outputs the minimum distance and optimal path for the salesman to take.## How to Run the Scripts
1. Make sure you have Python installed on your computer.
2. Clone this repository to your local machine.
3. Install the necessary Python packages with the following command:
```
pip install -r requirements.txt
```4. Run the desired script with the following command:
```
python .py
```