Compare commits

...

2 Commits

Author SHA1 Message Date
6aed675ecc feat: add release settings
All checks were successful
Continuous integration / Check (push) Successful in 31s
Continuous integration / Test Suite (push) Successful in 30s
Continuous integration / Rustfmt (push) Successful in 29s
Continuous integration / Clippy (push) Successful in 31s
Continuous integration / build (push) Successful in 34s
renovate / renovate (push) Successful in 32s
2025-03-17 22:42:06 +01:00
b42b8f5ced feat: add real coordinates 2025-03-17 22:41:53 +01:00
2 changed files with 20 additions and 5 deletions

View File

@ -6,3 +6,11 @@ edition = "2021"
[dependencies]
rand = "0.9.0"
rocket = "0.5.1"
[profile.release]
opt-level = 'z' # Optimize for size
lto = true # Enable link-time optimization
codegen-units = 1 # Reduce number of codegen units to increase optimizations
panic = 'abort' # Abort on panic
strip = true # Strip symbols from binary*

View File

@ -1,5 +1,5 @@
use rand::rng;
use rand::seq::SliceRandom;
//use rand::rng;
//use rand::seq::SliceRandom;
#[macro_use]
extern crate rocket;
@ -46,10 +46,17 @@ fn lin_kernighan(mut tour: Vec<usize>, cities: &[(f64, f64)]) -> Vec<usize> {
#[get("/")]
fn index() -> String {
let cities = vec![(0.0, 0.0), (1.0, 5.0), (5.0, 2.0), (6.0, 7.0), (3.0, 4.0)];
let cities = vec![
(50.03317681689108, 7.630692594382566),
(50.0511467529328, 7.610264891874095),
(50.07417811821386, 7.637215727783678),
(50.10154844328665, 7.683642662673185),
(50.070237512738046, 7.697022868469907),
(50.052876354261926, 7.6108551506699955),
];
let mut tour: Vec<usize> = (0..cities.len()).collect();
tour.shuffle(&mut rng());
let tour: Vec<usize> = (0..cities.len()).collect();
//tour.shuffle(&mut rng());
let best_tour = lin_kernighan(tour, &cities);