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 个评论

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 个)

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.

1 个评论

Thank you Matt ! I will try this and let you know. Have a nice day.

请先登录,再进行评论。

类别

帮助中心File Exchange 中查找有关 Startup and Shutdown 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by