Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add constraint to Model<Solved> #118

Closed
egaban opened this issue Nov 4, 2023 · 8 comments
Closed

Add constraint to Model<Solved> #118

egaban opened this issue Nov 4, 2023 · 8 comments

Comments

@egaban
Copy link

egaban commented Nov 4, 2023

I couldn't find in the documentation if there's a safe way to add a constraint after the model was solved

This could be useful for solving a TSP with lazy constraint generation, for instance

@mmghannam
Copy link
Member

Hi @egaban, yes this is not allowed because SCIP doesn't allow you to create a constraint after the model is solved. However, to implement these lazy constraints, you would need to implement the Constraint handler plugin (like in here). This is unfortunately not yet implemented in russcip.

@egaban
Copy link
Author

egaban commented Nov 7, 2023

@mmghannam Thanks for the clarification. Would it be possible to implement that in my own code using traits, like described in the readme? If it works I could create a fork and open a PR to add that

@mmghannam
Copy link
Member

That would be great @egaban, feel free to ask here or email me if you have any questions. Good luck, looking forward to your PR!

@mmghannam
Copy link
Member

I think I was complicating it too much, an easier way would be to add access to the SCIP freeTransform method that would free the underlying SCIP transformed problem and would return russcip's Model to the ProblemCreated state where one could add more variables and constraints.

This sounds like a more tangible goal, @egaban are you still interested in working on this?

@egaban
Copy link
Author

egaban commented Mar 3, 2024

Hi @mmghannam! I apologize for not having enough time to work on that earlier, but I'm still interested in contributing.

The alternative approach you suggested sounds easier to implement, though the Constraint Handlers might be a more robust solution. Maybe we can do the freeTransform first.

I've started learning about Rust FFI, but the main challenge for the Constraint Handlers now is figuring out how to do that in SCIP's C interface (I've never done that in C before), and in a generic way (unknown ConsData type). I estimate that I'll be ready to start working on this in about a month, if that's ok.

@mmghannam
Copy link
Member

No apologies needed! I'm happy to hear you're still interested. Let me know if I you need any help :)

@mmghannam
Copy link
Member

@egaban This should be kind of solved with #129. I added another issue #130 for the constraint handler plugin to track it so let's continue the discussion there when you have time to work on it.

@egaban
Copy link
Author

egaban commented Mar 13, 2024

That's great! Thanks for the update

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants