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 commentaire

Steven Lord
Steven Lord le 7 Juin 2016
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.

Connectez-vous pour commenter.

Réponses (1)

Matt J
Matt J le 7 Juin 2016
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 commentaire

Khaled MOULOUDI
Khaled MOULOUDI le 7 Juin 2016
Thank you Matt ! I will try this and let you know. Have a nice day.

Connectez-vous pour commenter.

Catégories

En savoir plus sur Mathematics dans Centre d'aide et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by