https://github.com/sor4chi/tsp-simulator
https://github.com/sor4chi/tsp-simulator
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/sor4chi/tsp-simulator
- Owner: sor4chi
- Created: 2024-07-18T18:05:34.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2024-07-18T18:31:11.000Z (10 months ago)
- Last Synced: 2025-02-06T05:44:12.990Z (3 months ago)
- Language: Rust
- Size: 133 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# TSP Simulator
This is a simple simulator for the Traveling Salesman Problem (TSP) using the following algorithms:
- 2-Opt (Simulated Annealing)
- Comming Soon...You can configure the parameters of the simulation in the `src/main.rs` file.
```rs
// === Parameters ===
let num_cities = 3000; // The number of cities
let seed = 42; // Random seed for generating cities
let config = AnnealingConfig { // Configuration for the 2-Opt algorithm
first_temp: 1e1, // Initial temperature
end_temp: 1e-4, // Final temperature
tl: 10, // Time limit
draw_interval: 100000000, // Interval for generating SVG files
report_interval: 10000, // Interval for printing the current state
};
let per_clean = true; // Perform a cleaning step after each iteration
// ==================
```To run the simulation, execute the following command:
```sh
cargo run --release
```## Showcase
- 2-Opt (Simulated Annealing)
- Number of cities: 3000
- Seed: 42
- Time limit: 10s
- Temperature: 1e1 -> 1e-4
![]()
![]()