[R] constrained input for optimization algorithm
Ravi Varadhan
RVaradhan at jhmi.edu
Fri Jul 31 18:15:44 CEST 2009
CRAN task view on "optimization and mathematical programming" shows the
following packages for integer programming:
IP (Integer programming, 90C10): glpk, lpSolve, lpSolveAPI, Rcplex, Rglpk,
Rsymphony
MIP (Mixed integer programming and its variants MILP for LP and MIQP for QP,
90C11): glpk, lpSolve, lpSolveAPI, Rcplex, Rglpk, Rsymphony
Ravi.
----------------------------------------------------------------------------
-------
Ravi Varadhan, Ph.D.
Assistant Professor, The Center on Aging and Health
Division of Geriatric Medicine and Gerontology
Johns Hopkins University
Ph: (410) 502-2619
Fax: (410) 614-9625
Email: rvaradhan at jhmi.edu
Webpage:
http://www.jhsph.edu/agingandhealth/People/Faculty_personal_pages/Varadhan.h
tml
----------------------------------------------------------------------------
--------
-----Original Message-----
From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org] On
Behalf Of Prof. John C Nash
Sent: Friday, July 31, 2009 7:04 AM
To: r-help at r-project.org
Subject: Re: [R] constrained input for optimization algorithm
As someone very involved with optim and its evolution I can say it is not at
all suited to this sort of combinatoric optimization. I don't know if there
are packages in R to help out -- it would be nice.
If (this may be a big IF) your set of possible combinations is not too
large, combn() generates the C(n,r) combinations and, assuming the function
is not too expensive to compute, one can use enumeration and be certain of
having the optimum.
choose(60,5) shows about 5.5 million sets. A bit tedious, but likely doable
over lunchtime. But choose(600,5) is >600 billion, and probably too heavy.
John Nash
>From: Zhi Xie <xiezhi at gmail.com>
>It seems that optimization algorithm, optim, tries to find optimized
>parameters within defined lower and upper bounds. In my problem, all >the
parameters are integers. My question is that if there is any means >that I
can let "optim" only tries mutual exclusive integers. To be >specific, I am
giving an example here.
>I tried to find a set parameters with five elements with the lowest
>value for the cost function. The parameter set that "optim" returned >is
"5, 5, 49, 51, 51". However, I only wanted to search unique >parameter
values, such as "5, 6, 49, 50, 51".
______________________________________________
R-help at r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
More information about the R-help
mailing list