Re: [R] Constrined dependent optimization.

2009-04-09 Thread Hans W. Borchers
Kevin, sorry I don't understand this sentence: "It has been suggested that I do a cluster analysis. Wouldn't this bet mepart way there?" Let your products be numbered 1, ..., n, and let p(i) be the location where product i is stored (assigned to) in the warehouse. Then p is a permutation of th

Re: [R] Constrined dependent optimization.

2009-04-04 Thread Hans W. Borchers
Just in case you are still interested in theoretical aspects: In combinatorial optimization, the problem you describe is known as the Quadratic (Sum) Assignment Problem (QAP or QSAP) and is well known to arise in facility and warehouse layouts. The task itself is considered hard, comparable to th

Re: [R] Constrined dependent optimization.

2009-04-03 Thread rkevinburton
I have decided to use this SANN approach to my problem but to keep the run time reasonable instead of 20,000 variables I will randomly sample this space to get the number of variables under 100. But I want to do this a number of times. Is there someone who could help me set up WINBUGS to repeat

Re: [R] Constrined dependent optimization.

2009-04-02 Thread Florin Maican
> Ph: (410) 502-2619 > > Fax: (410) 614-9625 > > Email: rvarad...@jhmi.edu > > Webpage: > http://www.jhsph.edu/agingandhealth/People/Faculty/Varadhan.html > > > > > > > > -Original Message----- > From: r-help-b

Re: [R] Constrined dependent optimization.

2009-04-02 Thread Paul Smith
On Thu, Apr 2, 2009 at 3:49 PM, wrote: > Sorry I sent a description of the function I was trying to minimize but I > must not have sent it to this group (and you). Hopefully with this clearer > description of my problem you might have some suggestions. > > It is basically a warehouse placement

Re: [R] Constrined dependent optimization.

2009-04-02 Thread Ravi Varadhan
lf Of Florin Maican Sent: Thursday, April 02, 2009 11:33 AM To: r-help@r-project.org Subject: Re: [R] Constrined dependent optimization. I tried many optimizers in R on my large scale optimization problems. I am not satisfied with their speed on large op problems. But you may try in this order

Re: [R] Constrined dependent optimization.

2009-04-02 Thread Ben Bolker
Just a quick thought: if you have the locations of the items along a line segment (the "warehouse"), can you find a way to formulate the problem so that the average distances represent a matrix calculation (i.e., multiply some huge matrix by the locations) then it's a linear problem ... It's t

Re: [R] Constrined dependent optimization.

2009-04-02 Thread Florin Maican
I tried many optimizers in R on my large scale optimization problems. I am not satisfied with their speed on large op problems. But you may try in this order nlminb ucminfucminf package spq BB package optim Is here someone that try to port Ipopt in R? https://projects.co

Re: [R] Constrined dependent optimization.

2009-04-02 Thread rkevinburton
Sorry I sent a description of the function I was trying to minimize but I must not have sent it to this group (and you). Hopefully with this clearer description of my problem you might have some suggestions. It is basically a warehouse placement problem. You have a warehouse that has many item

Re: [R] Constrined dependent optimization.

2009-04-02 Thread Paul Smith
As I told you before, without knowing the definition of your function f, one cannot help much. Paul On Wed, Apr 1, 2009 at 3:15 PM, wrote: > Thank you I had not considered using "gradient" in this fashion. Now as an > add on question. You (an others) have suggested using SANN. Does your answe

Re: [R] Constrined dependent optimization.

2009-04-01 Thread Ben Bolker
rkevinburton wrote: > > Thank you I had not considered using "gradient" in this fashion. Now as an > add on question. You (an others) have suggested using SANN. Does your > answer change if instead of 100 "variables" or bins there are 20,000? From > the documentation L-BFGS-B is designed for a

Re: [R] Constrined dependent optimization.

2009-04-01 Thread rkevinburton
Thank you I had not considered using "gradient" in this fashion. Now as an add on question. You (an others) have suggested using SANN. Does your answer change if instead of 100 "variables" or bins there are 20,000? From the documentation L-BFGS-B is designed for a large number of variables. But

Re: [R] Constrined dependent optimization.

2009-03-30 Thread Paul Smith
Apparently, the convergence is faster if one uses this new swap function: swapfun <- function(x,N=100) { loc <- c(sample(1:(N/2),size=1,replace=FALSE),sample((N/2):100,1)) tmp <- x[loc[1]] x[loc[1]] <- x[loc[2]] x[loc[2]] <- tmp x } It seems that within 20 millions of iterations, one gets th

Re: [R] Constrined dependent optimization.

2009-03-30 Thread Paul Smith
Optim with SANN also solves your example: --- f <- function(x) sum(c(1:50,50:1)*x) swapfun <- function(x,N=100) { loc <- sample(N,size=2,replace=FALSE) tmp <- x[loc[1]] x[loc[1]] <- x[loc[2]] x[loc[2]] <- tmp x } N <- 100 opt1 <- optim(fn=f,par=sam

Re: [R] Constrined dependent optimization.

2009-03-30 Thread Paul Smith
Actually, one can use lpSolve to find a solution to your example. To be more precise, it would be necessary to solve a sequence of linear *integer* programs. The first one would be: max f(x) subject to x >= 0 x <= 100 sum(x) = 100. >From this, one would learn the optimal position of the number

Re: [R] Constrined dependent optimization.

2009-03-30 Thread Hans W. Borchers
Image you want to minimize the following linear function f <- function(x) sum( c(1:50, 50:1) * x / (50*51) ) on the set of all permutations of the numbers 1,..., 100. I wonder how will you do that with lpSolve? I would simply order the coefficients and then sort the numbers 1,...,100 accord

Re: [R] Constrined dependent optimization.

2009-03-30 Thread Ben Bolker
rkevinbur...@charter.net wrote: > I am sorry but I don't see the connection. with SANN and say 3 > variables one of the steps may increment x[1] by 0.1. Not only is > this a non-discrete integer value but even if I could coerce SANN to > only return discrete integer values for each step in the opti

Re: [R] Constrined dependent optimization.

2009-03-30 Thread Paul Smith
I do not really understand your argument regarding the non-linearity of f. Perhaps, it would help us a lot if you defined concretely your objective function or gave us a minimal example fully detailed and defined. Paul On Mon, Mar 30, 2009 at 1:16 PM, wrote: > It would in the stictess sense be

Re: [R] Constrined dependent optimization.

2009-03-30 Thread rkevinburton
It would in the stictess sense be non-linear since it is only defined for descrete interface values for each variable. And in general it would be non-linear anyway. If I only have three variables which can take on values 1,2,3 then f(1,2,3) could equal 0 and f(2,1,3) could equal 10. Thank you f

Re: [R] Constrined dependent optimization.

2009-03-30 Thread Paul Smith
On Sun, Mar 29, 2009 at 9:45 PM, wrote: > I have an optimization question that I was hoping to get some suggestions on > how best to go about sovling it. I would think there is probably a package > that addresses this problem. > > This is an ordering optimzation problem. Best to describe it wit

Re: [R] Constrined dependent optimization.

2009-03-29 Thread Ben Bolker
rkevinburton wrote: > > I have an optimization question that I was hoping to get some suggestions > on how best to go about sovling it. I would think there is probably a > package that addresses this problem. > > This is an ordering optimzation problem. Best to describe it with a simple > exam

[R] Constrined dependent optimization.

2009-03-29 Thread rkevinburton
I have an optimization question that I was hoping to get some suggestions on how best to go about sovling it. I would think there is probably a package that addresses this problem. This is an ordering optimzation problem. Best to describe it with a simple example. Say I have 100 "bins" each wit