| Crates.io | tsplib-parser |
| lib.rs | tsplib-parser |
| version | 0.1.0 |
| created_at | 2025-06-07 07:52:58.605636+00 |
| updated_at | 2025-06-07 07:52:58.605636+00 |
| description | A parser for the TSPLIB format |
| homepage | |
| repository | https://github.com/Kurorororo/tsplib-parser |
| max_upload_size | |
| id | 1703781 |
| size | 70,824 |
Warning: This crate is work in progress and is not comprehensively tested!
In addition to the specifications by TSPLIB95, the following features are supported:
DISTANCE) and service time (SERVICE_TIME) for some instances in CVRPLIB.DEMAND_DIMENSION) for multi-commodity pickup-and-delivery TSP (m-PDTSP).use std::env;
use tsplib_parser::Instance;
fn main() {
let mut args = env::args();
args.next().unwrap();
let input = args.next().unwrap();
println!("Loading instance from file: {}", input);
let instance = Instance::load(&input).unwrap();
println!("{:?}", instance);
let matrix = instance.get_full_distance_matrix().unwrap();
println!("{:?}", matrix);
}