How to solve linear programming problem?

I have a problem that looks like:
min z=sum(x_ij*c_ij) (sum across ij, c_ij are constants)
s.t.
sum (x_ij)=1 (sum across i)
sum (x_ij)=1 (sum across j)
x_ij=0or1 any ij
If I use linprog, the matrix of x is a n by 1 matrix, but here I have a n by n matrix, so I cannot directly use linprog. How can I solve this problem?
Thanks,
zwang244

Respuestas (2)

Walter Roberson
Walter Roberson el 9 de Nov. de 2016

0 votos

You reshape the n x n matrix into a vector.
Torsten
Torsten el 9 de Nov. de 2016

0 votos

By defining y((i-1)*n+j)=x(i,j), you get an (n^2x1) vector to be solved for.
Best wishes
Torsten.

Categorías

Más información sobre Linear Programming and Mixed-Integer Linear Programming en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 8 de Nov. de 2016

Respondida:

el 9 de Nov. de 2016

Community Treasure Hunt

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

Start Hunting!

Translated by