tsplib-parser

Crates.iotsplib-parser
lib.rstsplib-parser
version0.1.0
created_at2025-06-07 07:52:58.605636+00
updated_at2025-06-07 07:52:58.605636+00
descriptionA parser for the TSPLIB format
homepage
repositoryhttps://github.com/Kurorororo/tsplib-parser
max_upload_size
id1703781
size70,824
(Kurorororo)

documentation

README

Parser for the TSPLIB format in Rust

crates.io minimum rustc 1.76 License License: MIT

Warning: This crate is work in progress and is not comprehensively tested!

In addition to the specifications by TSPLIB95, the following features are supported:

Examples

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);
}
Commit count: 1

cargo fmt