i********c 发帖数: 54 | 1 is it possible to solve the optimization problem if the objective function
cannot be described directly as f(x)?
i.e.,
there are 6 balls (1,2, 3, 4, 5, 6) whose weight are 10, 10, 20, 20, 30, 30,
kg. the objective is to put them into 3 bags such that the balls in each bag
has the same weight. The solution is obvious: put 1&2 in bag A, 3&4 in bag B,
5&6 in bag C. Is it possible to do so in GAMS?
define
W(i) = /1, 1, 2, 2, 3, 3/ (weight of each ball)
WAvg(j) = average weight of balls in the | X****r 发帖数: 3557 | 2 I don't know the GAMS at all, but the easy way to model this
kind of problem is using an assigment matrix x_{ij},
with x_{ij} = 1 if the ball i is in bag j, 0 otherwise.
so we have constraints:
x_{ij} >= 0
x_{ij} <= 1
\sum_j x{ij} = 1
Denote the weight for ball i is w_i.
For all j, we want w_i be the same for all i that x_{ij}=1,
i.e. w_i*x_{ij} and x_{ij} linearly dependent. if we define
o_j = (\sum_i (w_i^2*x_{ij}^2))(\sum_i x_{ij}^2) - (\sum_i (w_i*x_{ij}^2))^2
then using Cauchy-Schwarz inequ
【在 i********c 的大作中提到】 : is it possible to solve the optimization problem if the objective function : cannot be described directly as f(x)? : i.e., : there are 6 balls (1,2, 3, 4, 5, 6) whose weight are 10, 10, 20, 20, 30, 30, : kg. the objective is to put them into 3 bags such that the balls in each bag : has the same weight. The solution is obvious: put 1&2 in bag A, 3&4 in bag B, : 5&6 in bag C. Is it possible to do so in GAMS? : define : W(i) = /1, 1, 2, 2, 3, 3/ (weight of each ball) : WAvg(j) = average weight of balls in the
| i********c 发帖数: 54 | 3 Thanks Xentar for comments.
The original problem is simplified to some extent. In general, it might not be
quadratic objective function. It is the reason that I want to use GAMS, which
is supposed to be powerful for NLP, MINLP, etc.
However, it seems GAMS is quite limited on this type of problem ...
optimization
30,
bag
B,
【在 X****r 的大作中提到】 : I don't know the GAMS at all, but the easy way to model this : kind of problem is using an assigment matrix x_{ij}, : with x_{ij} = 1 if the ball i is in bag j, 0 otherwise. : so we have constraints: : x_{ij} >= 0 : x_{ij} <= 1 : \sum_j x{ij} = 1 : Denote the weight for ball i is w_i. : For all j, we want w_i be the same for all i that x_{ij}=1, : i.e. w_i*x_{ij} and x_{ij} linearly dependent. if we define
|
|