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
- English guide: README_EN.md
- 中文说明: README_ZH.md
geosteiner_wrapper/: Python API and workflowsnative_bridge/: C bridge sources for CLI/DLL integrationscripts/: Windows build scripttests/: automated teststest_geo.py: example scriptgeosteiner-5.3/: bundled upstream GeoSteiner source
- 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
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)From PowerShell:
powershell -ExecutionPolicy Bypass -File .\scripts\build_windows.ps1If MSYS2 is not installed in C:\msys64, pass the path explicitly:
powershell -ExecutionPolicy Bypass -File .\scripts\build_windows.ps1 -MsysRoot D:\msys64The 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
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:
- English: README_EN.md
- 中文: README_ZH.md