Simple Optimization with integer vector
이전 댓글 표시
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
Torsten
2017년 3월 6일
Do you mean you want to maximize
transpose(A)*B ?
Best wishes
Torsten.
fr_sk
2017년 3월 6일
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
2017년 3월 6일
0 개 추천
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.
카테고리
도움말 센터 및 File 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!