Skip to content

The traveling salesman is a lively, outgoing person who visits different towns to sell products. Dressed in a smart suit and carrying a briefcase full of samples, he engages with locals, sharing stories and making sales pitches.

Notifications You must be signed in to change notification settings

Jimmyu2foru18/Traveling-Salesman

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Traveling Salesman Visualization

A Processing application that visualizes the classic Traveling Salesman Problem (TSP) using a brute-force approach to find the optimal route between cities.

Requirements

Installation

  1. Clone this repository:

    git clone https://github.com/Jimmyu2foru18/Traveling-Salesman.git
  2. Open the project in Processing:

    • Launch Processing IDE
    • File -> Open -> Navigate to Traveling_Salesman.pde

Running the Application

  1. Click the "Run" button in Processing IDE, or press Ctrl + R (Windows/Linux) or Cmd + R (Mac)
  2. The application will:
    • Generate 10 random cities
    • Calculate the optimal route
    • Display an animation of the route

Project Structure

  • Traveling_Salesman.java - Main application code
  • Instructions.md - Detailed documentation of how the application works
  • README.md - This file

How It Works

The application:

  1. Generates random cities on an 800x800 canvas
  2. Uses a brute-force algorithm to find the shortest possible route
  3. Visualizes the route with:
    • Black dots representing cities
    • Red lines showing the optimal path
    • Blue dot animating the journey between cities

Limitations

  • Due to the brute-force approach, the application works best with 10 or fewer cities
  • Performance decreases exponentially with additional cities due to factorial time complexity

Acknowledgments

  • Based on the Traveling Salesman Problem, a classic computer science challenge
  • Built with Processing, a flexible software sketchbook

About

The traveling salesman is a lively, outgoing person who visits different towns to sell products. Dressed in a smart suit and carrying a briefcase full of samples, he engages with locals, sharing stories and making sales pitches.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published