Simple Optimization with integer vector

조회 수: 5 (최근 30일)
fr_sk
fr_sk 2017년 3월 4일
댓글: fr_sk 2017년 3월 7일
Dear all,
I have a very easy optimization problem but I am not sure how do formulate it for the optimization toolbox.
The basic version of my problem is the following: f= max A*B
in which B is vector of decision variables: B = [b(1); b(2); ...; b(n)]
and A is a vector (length: n) filled with integers (real world data): e.g. A = [53; 12; ...; 47]
then I have a matrix C with simple constraints regarding the range of b(i). So I want to find the the n optimal values of b(i) (constrained by C).
My assumption was, that I could just use intlinprog for this:
x = intlinprog(f,A,B,C) ... but it doesn't work like that.
Do you guys have an idea how to formulate this for intlinprog (or which command to use instead)
Thanks a lot!
  댓글 수: 3
fr_sk
fr_sk 2017년 3월 6일
Hello Torsten, thanks for the response. I want to maximize
A .* B
where A contains real-world data and B contains variables that can take on the values constrained by C.
John D'Errico
John D'Errico 2017년 3월 6일
Whatare your constraints?
Bound constraints?
LINEAR equality constraints?
LINEAR inequality constraints?
What is C? What does it mean? You cannot simply state that B is constrained by C. That has no meaning, to anyone but you.
Next, You state you want to maximize A.*B. Again, thismakes no sense, since A.*B wll generate a VECTOR. You cannot optimize a vector.
So do you want to maximimze A*B, i.e, dot(A,B)?

댓글을 달려면 로그인하십시오.

답변 (1개)

John D'Errico
John D'Errico 2017년 3월 6일
First, read the help for intlinprog.
Next, intlinprog is a minimizer. You want to maximize. Assuming that you really need to maximize dot(A,B), where A is a vector, then you would need to minimize dot(-A,B) using intlinprog.
Once you are able to tell me what the constraints are in C, I will answer the remainder of your question.
  댓글 수: 1
fr_sk
fr_sk 2017년 3월 7일
Hello John D'Errico,
thanks for your answer, I am going to try to specify my problem:
Let's say I want to optimize the following functions
2x(1) + 5y(1)
6x(2) + 7y(2)
4x(3) + 3y(3)
... ...
x(n) + y(n)
constrained by
x(1,2,...n) >= 20
y(1,2,...n) >= 10
x(1,2,...n) > 0
y(1,2,...n) > 0
The integers for these problems are stored in vectors of length n:
A = [2; 6; 4; ...]
B = [5; 7; 3; ...]
I now want to obtain the optimal (let's say it's an minimization) n values for x(1,2,...,n) and y(1,2,...,n).
Thanks a lot for looking into this.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Linear Programming and Mixed-Integer Linear Programming에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by