m3g / SPGBox.jl

Spectral Projected Gradient Method for Box-Constrained Minimization
MIT License
17 stars 3 forks source link

Feature question: linear constraints #18

Open donboyd5 opened 11 months ago

donboyd5 commented 11 months ago

Hi. Thanks again for this great package.

I am wondering whether you have any plans to implement linear constraints in SPGBox. How to do it is way beyond anything I know, but as I understand it, I think this is possible with spectral projection gradient methods. For example, the R package BB apparently allows it --see this, p.13.

Many thanks.

Don

lmiq commented 11 months ago

Actually I have a plan to support general non-linear constraints, but it is not something I plan to do in any near future. I'm not sure either if that makes sense within this package or if it will be another independent implementation with this one as a dependency.

pjssilva commented 11 months ago

This is only my two cents. But I am not aware of someone using spectral methods to deal with general nonlinear constraints successfully. I know that Mario (Martínez) and Ernesto (Birgin) tried to use a spectral method in an Augmented Lagrangian framework, and it did not perform well. It was worse than Quacan, the method they use to solve the subproblems of the augmented Lagrangian in their Algencan implementation. As a matter of fact, if you want to use Algencan in Julia you can use the NLPModelsAlgencan.jl package (https://github.com/pjssilva/NLPModelsAlgencan.jl). There is also the very good Ipopt solver that has a package to use it in Julia.

donboyd5 commented 11 months ago

Great to hear that! It will make the package (or independent implementation) even better.

pjssilva commented 11 months ago

Ops... I forgot to mention. An intermediate alternative is to make the method receive the projection onto the feasible set as a function, instead of hard-coding a specific set (a box). This is an easy change to make Leandro, and then the user that wants to deal with different constraints should be responsible to give the function that implements the projection. We can give some pre-defined projections like Box, Ball, Simplex (I have a good method for that). Unfortunately, projection onto a general polyhedron is not that easy. It is easy to implement (using a general quadratic programming solver), but the projection can be quite expensive and this would slow down the method.

lmiq commented 11 months ago

Indeed, in fact JMM passed me a routine with the AL-SPG implementation, and that is what I was planning to port here. But I don't know how well it performs.