I tried to program a simple linear optimization model and don't know where my mistake lies. The function should be a sum over "t" and "z" from the product of two constants ("e" and "H") and the decision variable "X". The first constraint should say that every decision variable "X" (for all "t" and "z") can only take the value 0 or 1. The second constraint should say that every decision variable "X" (for all "t") can only select one option z. Therefore the sum of all "X" over "z" (for all "t") has to be equaling 1. The third constraint should say the same as the second only the other way around.
NMinimize[{Sum[
Subscript[e, t]*Subscript[H, z]*Subscript[X, t, z] , {t, 1,
34}, {z, 1, 34}u],
ForAll[{t, z}, Subscript[X, t, z] \[Element] Integers,
0 <= Subscript[X, t, z] <= 1] &&
ForAll[t, Sum[Subscript[X, t, z], {z, 1, 34}] == 1, {t, 1, 34} ] &&
ForAll[z,
Sum[Subscript[X, t, z], {t, 1, 34}] == 1, {z, 1,
34}]}, {Subscript[X, t, z]}]



NMinimizeon an unspecified number of variables such asSubscript[X, t, z]– chris Nov 13 '12 at 7:18Flatten[Table[Subscript[X, t,z],{t,34},{z,34}]]at the end. Though its not sufficient to make it work – chris Nov 13 '12 at 8:50