I'm intending to conduct a linear program using Excel VBA. I am a novice in doing these type of problems in VBA, and hence I've followed an example in order to get some insight into this:
Dim c As Vector = Vector.Create(-1.0, -3.0, 0.0, 0.0, 0.0, 0.0)
Dim A As Matrix = Matrix.Create(4, 6, New Double() _
{ _
1, 1, 1, 0, 0, 0, _
1, 1, 0, -1, 0, 0, _
1, 0, 0, 0, 1, 0, _
0, 1, 0, 0, 0, 1 _
}, MatrixElementOrder.RowMajor)
Dim b As Vector = Vector.Create(1.5, 0.5, 1.0, 1.0)
Dim lp1 As LinearProgram = New LinearProgram(c, A, b, 4)
The problems I've stumbled upon though is:
is there a way to construct constraints of the type:
sum{i in I} x[i,j], for all j in J
?And are there other ways to construct constraints rather than "manually" creating the constraint matrix, A (in this example) for types when there are a vast amount of constraints and/or variables?