Skip to content

DE optimization with equality constraint

4 messages · Hans W Borchers, Paul Smith

#
One can get an accurate solutons applying the "Differential Evolution" algorithm
as implemented in the DEoptim package:

    f2 <- function(x){
        if (x[1] + x[2] < 1 || x[1] + x[2] > 1) {
            r <- Inf
        } else {
            r <- x[1]^2 + x[2]^2
        }
        return(r)
    }

    lower <- c(0, 0)
    upper <- c(1, 1)

    DEoptim(f2, lower, upper, control=list(refresh=200))$bestmem

    iteration:  200 best member:  0.5 0.5 best value:  0.5

This approach assumes nothing about the gradient, hessian or whatever. And the
equality is split into two inequalities assuming no relaxation or penalty.
Andreas Klein <klein82517 <at> yahoo.de> wrote:
#
On Sat, Mar 29, 2008 at 9:33 PM, Hans W. Borchers <hwborchers at gmail.com> wrote:
The problem with DEoptim approach is that is not guaranteed that it
converges to the solution. Moreover, from my experience, it seems to
be quite slow when the optimization problem is high-dimensional (i.e.,
with many variables).

Paul
1 day later
#
Paul Smith <phhs80 <at> gmail.com> writes:
There is a difference between local and global optimization:

'optim' realizes *local* optimization using a gradient-based approach.
This is fast, but will get stuck in local optima (except method SANN). 
'DEoptim' is one of many approaches to *global* optimization, of which
each has its advantages and drawbacks.
As a local optimization routine, also 'optim' does not guarantee to
  reach a (global) optimum.
This is normal for routines in global optimization as they have to
  search a quite large space.

Hans Werner
#
On Mon, Mar 31, 2008 at 5:14 PM, Hans W. Borchers <hwborchers at gmail.com> wrote:
Regarding this point, I agree with you.
Yes, but with optim one can be (almost) sure that the solution
returned is an optimum (at least locally); with DEoptim one cannot be
sure about that (it may be a non-optimum, locally or globally).
Surely, but just try to solve an optimization problem with 100
variables with both approaches. In spite of being the same problem,
you will probably see that optim is far faster than DEoptim.

Paul