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

Setting initial solutions not obtained from previous runs #37

Open
KnorpelSenf opened this issue Dec 26, 2024 · 11 comments
Open

Setting initial solutions not obtained from previous runs #37

KnorpelSenf opened this issue Dec 26, 2024 · 11 comments

Comments

@KnorpelSenf
Copy link

I would like to solve an ILP based on a good initial solution that I can construct manually. I am aware of https://docs.rs/coin_cbc/latest/coin_cbc/struct.Model.html#method.set_initial_solution and https://docs.rs/coin_cbc/latest/coin_cbc/struct.Solution.html but I do not see a way to construct a Solution from scratch without running the solver.

Is this possible and I'm just missing something? If it is not possible: would you be willing to add this?

Context: I am working on rust-or/good_lp#71

@TeXitoi
Copy link
Collaborator

TeXitoi commented Dec 26, 2024

@KnorpelSenf
Copy link
Author

KnorpelSenf commented Dec 26, 2024

This makes no sense. ILP solutions are vectors. Vectors only have a single column. Perhaps this crate uses a non-standard ILP formulation that isn't documented anywhere, or perhaps it requires developers to have knowledge about CBC which does this?

But alright, my takeaway here is that there is a way to do what I'm asking for. I'll just read the source code of this project and then I'm sure I'll figure it out eventually.

Would you accept contributions to the documentation?

@TeXitoi
Copy link
Collaborator

TeXitoi commented Dec 26, 2024

That's a matrix. Rows are constraints ans columns are variables. That's the coin vocabulary.

@TeXitoi
Copy link
Collaborator

TeXitoi commented Dec 26, 2024

That's also very standard MILP vocabulary.

@KnorpelSenf
Copy link
Author

But … variables don't appear in the constraint matrix, do they?

Can you link me to a web page that describes this vocabulary? I've only worked with ILPs for a few years and I've never encountered this notation.

@TeXitoi
Copy link
Collaborator

TeXitoi commented Dec 26, 2024

Documentation is welcome. Just don't revrite the official coin documentation.

@KnorpelSenf
Copy link
Author

A paper with this notation is fine too btw

@KnorpelSenf
Copy link
Author

That's a matrix. Rows are constraints ans columns are variables. That's the coin vocabulary.

So it's kinda like Ax ≤ b is multiplied out in some way? I really can't find any relevant docs for this

@TeXitoi
Copy link
Collaborator

TeXitoi commented Dec 26, 2024

https://coin-or.github.io/Cbc/Doxygen/Cbc__C__Interface_8h.html#a67aa075a0a8bd6c95a9d23318e282d5d

You have a lot of papers on "column generation", which mean adding dynamically variables in a problem https://en.m.wikipedia.org/wiki/Column_generation you'll find similarly row generation.

I agree that's a bit a technical deformation of the meaning of the A matrix, that represent the coefficient of the variables (by columns) on the constraints (by row).

@KnorpelSenf
Copy link
Author

Fascinating, thanks for sharing. I'll step into the rabbit hole in the coming days and then return with documentation understandable by mere mortals.

I have only really done theoretical work so I have very limited experience with how solvers work internally and what they do in order to be fast. I guess that's why there's a bit of a gap to bridge here.

@TeXitoi
Copy link
Collaborator

TeXitoi commented Dec 26, 2024

The technical detail is that adding a variable to the problem is (mainly) adding a column to the A matrix.

But that's true that I have a bit overused this to name the types "row" and "col", so the set_col_initial_solution is a bit strange.

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