I am working on a Mixed Integer Programming Model in Pyomo and hope to set initial values for my decision variables (which is a matrix in my case). How can I do that?
To be more specific, the following can succeed in setting a initial guess of 2 on the (scalar) decision variable y.
model.y = Var(initialize=2)
However, what if model.x is a 3-by-2 matrix and I want to make an initial guess for each of its elements? For instance, I tried something like the following without success:
model.I = RangeSet(3)
model.J = RangeSet(2)
model.K = Set(within=model.I *model.J)
model.x = Var(model.K, initialize=np.randomize(3,2))
Could someone help with this? Thanks much.