Giter Site home page Giter Site logo

elkai-rs's Introduction

elkai-rs - a Rust library for solving TSP problems

crates.io docs repo


Installation

[dependencies]
elkai-rs = "0.1.7"

Example usage

use std::collections::HashMap;
use elkai_rs::Coordinates2D;

fn main() {
    let cities = Coordinates2D::new(HashMap::from_iter([
        ("city1", (0.0, 0.0)),
        ("city2", (0.0, 4.0)),
        ("city3", (5.0, 0.0))
    ]));
    println!("{:?}", cities.solve(10));
}
use elkai_rs::DistanceMatrix;

fn main() {
    let cities = DistanceMatrix::new(vec![
        vec![0, 4, 0],
        vec![0, 0, 5],
        vec![0, 0, 0]
    ]);
    println!("{:?}", cities.solve(10));
}

License

The LKH native code by Helsgaun is released for non-commercial use only. Therefore the same restriction applies to elkai-rs, which is explained in the LICENSE file.

How it works internally

  • We link the C api of elkai to Rust with cc-rs.

โš ๏ธ elkai-rs takes a global mutex (just like what elkai did) during the solving phase which means two threads cannot solve problems at the same time. If you want to run other workloads at the same time, you have to run another process.

elkai-rs's People

Contributors

fikisipi avatar hellowhatas avatar

Watchers

 avatar

elkai-rs's Issues

Sync with upstream `HellOwhatAs/elkai`

git clone https://github.com/HellOwhatAs/elkai.git
git clone https://github.com/HellOwhatAs/elkai-rs.git

cd elkai
# do some changes
git push
cd ..

cd elkai-rs
git remote add elkai  https://github.com/HellOwhatAs/elkai.git
git pull elkai master
git push

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.