Skip to content

🎮 [Proposal]: Add interactive Traveling Salesperson (TSP) Visualizer to utilities lab #1310

Description

@KunwarSidhu47

Description

Implement a new interactive visualizer for the Traveling Salesperson Problem (TSP) in the utilities category. This tool will allow users to generate random nodes (cities) on a canvas and visualize how different algorithms attempt to find the shortest path that visits every node exactly once.

Proposed Features

  • Interactive Node Placement: Allow users to click on the canvas to add nodes or generate $N$ random nodes automatically.
  • Algorithm Implementations:
    • Greedy Search (Nearest Neighbor)
    • Simulated Annealing
    • Genetic Algorithm (Bonus)
    • Brute Force (for small $N$)
  • Real-time Visualization: Show the current best path updating dynamically, along with a live counter of the current shortest distance calculated.
  • Playback Controls: Play, pause, and step-by-step execution.

Technical Details

  • Create entry in projects_registry.json under utilities.
  • Implement core logic in a new TSP-Visualizer.py script for the Python lab.
  • Build corresponding web visualization using the HTML5 Canvas API in the web app, similar to the existing pathfinding-visualizer.js.

Definition of Done

  • TSP visualizer added to the registry.
  • Python CLI/Pygame implementation completed.
  • Web-based UI with interactive canvas implemented.
  • At least two solving algorithms are visualized.

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions