Skip to content

Cui-Git-Hub/geosteiner-windows-python

Repository files navigation

GeoSteiner 5.3 Windows Python Wrapper

A Windows-native Python wrapper around GeoSteiner 5.3, with:

  • a Python package: geosteiner_wrapper
  • a native CLI bridge: gst_python_cli.exe
  • a native DLL bridge: gst_python_bridge.dll
  • reusable solve workflows
  • SVG visualization output
  • Windows build tooling based on MSYS2 + MinGW-w64

Language

What This Repository Contains

  • geosteiner_wrapper/: Python API and workflows
  • native_bridge/: C bridge sources for CLI/DLL integration
  • scripts/: Windows build script
  • tests/: automated tests
  • test_geo.py: example script
  • geosteiner-5.3/: bundled upstream GeoSteiner source

Main Capabilities

  • Solve Steiner tree problems from Python on Windows
  • Use backend="auto" to prefer the DLL and fall back to the CLI
  • Export an SVG visualization of the solved tree
  • Keep the Python-side API stable while switching native backends underneath

Quick Example

from geosteiner_wrapper import solve_and_write_steiner_tree_svg

points = [(0, 0), (0, 1), (1, 0), (1, 1)]
result, svg_path = solve_and_write_steiner_tree_svg(
    points,
    mode="rectilinear",
    backend="auto",
    output_path="steiner_tree_visualization.svg",
)

print(result.total_length)
print(result.backend)
print(svg_path)

Build On Windows

From PowerShell:

powershell -ExecutionPolicy Bypass -File .\scripts\build_windows.ps1

If MSYS2 is not installed in C:\msys64, pass the path explicitly:

powershell -ExecutionPolicy Bypass -File .\scripts\build_windows.ps1 -MsysRoot D:\msys64

Example Output

The example script test_geo.py solves a sample Euclidean Steiner tree and writes:

  • console output with total length, backend, elapsed time, and edge list
  • an SVG visualization file: test_geo_visualization.svg

License Note

This repository includes the upstream geosteiner-5.3 source tree. The bundled GeoSteiner license states that the GeoSteiner portions are licensed under Creative Commons Attribution-NonCommercial 4.0 International. If you publish or reuse this repository, keep the original notices intact and review:

Full Documentation

About

Windows-native Python wrapper for GeoSteiner 5.3 with DLL/CLI backends, MSYS2 build scripts, tests, and SVG visualization workflows. Includes bundled upstream source under CC BY-NC 4.0.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors