-
Notifications
You must be signed in to change notification settings - Fork 19
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
Support for parametric LPs #1
Comments
I'm not 100% sure if SoPlex would complain if you do this since your entering variables/constraints are presumably not always improving, but you could try and write your own SpxPricer that selects the entering variable/constraint. You are correct that simply setting the basis to something different will trigger a new factorization. |
I do not think that a custom pricer will help in this scenario: The toy problem in the link above is the following:
The lower bounds are x, y >= 1 and remain constant. The upper bounds on x and y move from (2, 2) to (10, 10). After I solve the initial problem, the optimal Basis consists of the bounds So I know that for upper bounds ranging from (2, 2) to (2.4, 2.4) (inclusive), the Basis remains optimal. Afterwards, the constraint I could probably use a pricer after setting the bounds accordingly, but that is kind of an ugly hack and I risk walking past other Bases. Directly changing Bases would be a lot easier in my opinion. Btw: If you don't want to extend the API, we could hack on SoPlex directly... |
Let me chime in here, Leon is afk. If the problem is that methods like enter() are private, then one solution I could recommend is to implement the parametric optimize call inside the SPxSolverBase class and rather expose this via the API. The method performSolutionPolishing there could be interesting to look at, since it also changes basis on the optimal hyperplane. I am not sure whether this is a reasonable way to go for you. But I am not sure we want to invest in exposing efficient basis manipulations to the top level API currently. |
Hello Ambros, I actually talked to Leon a little last Friday. He also pointed me towards the solution polishing as a way to switch bases. I have been hacking directly on the SoPlex code itself. One problem from the design aspect is that I need to be able to solve the initial LP pretty much with a black-box simplex and then perform very low-level manipulations afterwards. Another significant problem is that once I change the upper / lower bound, SoPlex discards the current basis outright, an uninitializes the entire solution process. I think that this is overly pessimistic even in the case of ordinary LPs. After all, the basis matrix is still regular, and possibly even still optimal... |
Cool. The latter we should definitely change. Can you open a separate specific issue and assign to Leon? |
For a research project I need to solve LPs which are parametric in their respective variable bounds, i.e. of the type
min c^T x,
s.t. lhs <= Ax <= rhs
l(a) <= x <= u(a)
where l(a) and u(a) are convex combinations in the parameter a in [0, 1]. Essentially, I would like to compute all vertices on the piecewise linear solution path over a and use them in a subsequent step.
I started to write a parametric solver based on SoPlex, but I think the API is lacking some functionality that I require.
Notably, it seems that LP bases cannot be directly modified by adding / removing variables or constraints. The enter() method of the solver is private and therefore inaccessible. Getting the Basis, manipulating it and setting it afterwards is likely to be inefficient, since it presumably discards the current factorization of the basis matrix.
Could you make it possible for a user to manually enter variables or constraints into the basis?
The text was updated successfully, but these errors were encountered: