1 unstable release

0.1.0 Jun 7, 2025

#1163 in Parser implementations

Download history 106/week @ 2025-06-03 8/week @ 2025-06-10

114 downloads per month

MIT/Apache

58KB
1.5K SLoC

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);
}

No runtime deps