geosteiner

Crates.iogeosteiner
lib.rsgeosteiner
version0.1.0
created_at2025-03-24 15:17:15.499664+00
updated_at2025-03-24 15:17:15.499664+00
descriptioncompute Euclidean and recitlinear Steiner trees using the geosteiner C library
homepage
repositoryhttps://github.com/CinusMinus/geosteiner
max_upload_size
id1603881
size3,262,688
Max Göttlicher (CinusMinus)

documentation

README

geosteiner bindings

crates.io crates.io docs.rs

Compute Euclidean and rectilinear minimum Steiner trees using safe bindings to the geosteiner C library.

Usage

The library provides two functions to compute the Euclidean and rectilinear minimum Steiner trees.

use geosteiner::euclidean_steiner_tree;

fn main() {
    let terms = [[0.0, 0.0], [1.0, 0.0], [0.0, 1.0], [1.0, 1.0]];
    let tree = euclidean_steiner_tree(&terms);
    println!("found tree with length {}", tree.length);
    println!("steiner points: ");
    println!("{:.2?}", tree.steiner_points);
    println!("edges: ");
    println!("{:?}", tree.edges);
    println!("length: {:.2}", tree.length);
}

Safety

This crate is just a wrapper around the geosteiner C library. While care has been taken to ensure that all ffi calls are safe, the underlying C code may still contain bugs that could lead to memory unsafety. We take no responsibility for the geosteiner C library and state that its authors are unaffiliated with this crate.

License

Unfortunately, geosteiner itself is licensed under CC-BY-NC, so these bindings are limited to the same license.

Commit count: 10

cargo fmt