Closed CADBIMDeveloper closed 1 year ago
Here is the situation:
So the only workaround is to use CP-SAT which supports callbacks in all languages. The only limitation is that it does not support continuous variables.
I hope this workaround is sufficient.
What language and solver does this apply to? Solver: Linear Solvers, which support callbacks (SCIP for example) Languages: C#, C++ Version: building from stable branch
Describe the problem you are trying to solve. 1) Track feasible solutions from solver to be able to use them in case when user doesn't want to wait for the optimal one 2) Use (1 - current MIP GAP) as a "percentage", just for the UI
Describe the solution you'd like Expose linear solvers callback functionality to .Net
Additional context I tried to implement it myself, but unfortunatelly I don't have an appropriate experience with C++ and SWIG.
What I've done: I added a new C++ class:
I added the following pieces of the code to linear_solver.i file:
My C# code:
I also tried to use LinearSolutionCallback in C++ program. It works!
I'll be happy to create a pull request if you help me to find out what is going wrong. I tried to compare Google.OrTools.Sat.SolutionCallback and Google.OrTools.LinearSolver.LinearSolutionCallback wrapper classes and did't find any meaningfull difference.
Thank you!