Minimize objective function with sums
이전 댓글 표시
Morning everybody ! I'm kind of a total newbie in Matlab and ILP problems and I would like to ask for you help. I'm trying to solve this objective function :

I read about the intlinprog function but the examples I found didn't help me, especially since I have two constraints with a sum.
The B variables are binary and this is about two graphs (where n are the nodes and e the edges).
I would love if anyone could help me with that. If anything isn't clear, please let me know so I can add more explanation.
Thanks for all of you ! Best Regards.
댓글 수: 1
Steven Lord
2016년 6월 7일
What does this problem represent in terms of a graph? I'm guessing the binary variables are being used to select some subset of the nodes and edges of your original graph -- what is that subset intended to minimize? Perhaps there's a way to use the graph algorithm functionality introduced in release R2015b to solve the problem as a graph problem rather than an ILP.
답변 (1개)
Matt J
2016년 6월 7일
Well, a 2-dimensional sum can always be rewritten as a 1-dimensional sum if that's what you're asking. For example, if you have
A=rand(5);
B=randi(1,5);
then sum(sum(A.*B)) is the same as sum(A(:).*B(:)). Once you have things formulated in 1-dimensional, it should be straightforward to express the sums via matrix multiplication,
A(:).'*B(:)
as required by intlinprog.
카테고리
도움말 센터 및 File Exchange에서 Mathematics에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!