google / or-tools

Google's Operations Research tools:
https://developers.google.com/optimization/
Apache License 2.0
11.19k stars 2.12k forks source link

Add support for Go to the Linear Solver #1881

Closed sauterp closed 1 year ago

sauterp commented 4 years ago

What language and solver does this apply to? Go; Linear Solver

Describe the problem you are trying to solve. I wanted to use the Linear Solver in a Go application on Windows and Linux.

Describe the solution you'd like I forked OR-Tools and converted the SWIG interface for the linear_solver component for Python to work with Go. The build process works on Windows and I documented it here.

Describe alternatives you've considered I am not aware of any Go package that allows you to setup and solve linear optimization models conveniently and with a unified interface for different solvers. There have been two good attempts:

Additional context My use case: I work with heuristics for some NP-hard problems. It's easy to implement a program in Python to solve one LP. But if I want to solve N^2 smaller LPs for example, the Python overhead becomes very noticeable. With Go, I can get better performance and I can deploy my work on other systems with minimal dependencies. An advantage over C++ in this case is that others can reuse or maintain my work more easily.

Mizux commented 4 years ago

duplicate of #953, please take a look at https://github.com/google/or-tools/issues/953#issuecomment-491891217

TLDR: no against it, but no bandwidth for the foreseeable future...

gonzojive commented 4 years ago

I took a stab at this in a small project that builds with Bazel: https://github.com/gonzojive/or-tools-go

I don't know a lot about C and C++ toolchains, and makefiles, so Bazel was the simplest way to get it working for me. I will follow up in #953 instead to see about merging the project into the official or tools repo.

lperron commented 1 year ago

Duplicate of #953