190 Reputation

5 Badges

14 years, 331 days

MaplePrimes Activity

These are questions asked by Teep

If binary constraints are imposed on an optimization problem and LPSolve presents a solution, is it possible to extract the variables that have zero or one assigned to them? This would be most useful if there are many variables, for example...

If a solution is returned that looks like ...

[x[001]=0, x[101]=1, x[201]=0, x[301]=1, ....], how can I filter those solutions that equal zero?

Thanks for reading!

I was curious to know if one can extract a specific solution from a LPSolve routine. 

As an example, consider the following output to a constrained linear problem. The objective value is 8 and the decision variable values (binary) are given.

Sol := [8, [w[1, 1] = 1., x[0, 0, 1] = 0, x[0, 1, 1] = 1, x[0, 2, 1] = 0, x[1, 0, 1] = 0, x[1, 1, 1] = 0, x[1, 2, 1] = 1, x[2, 0, 1] = 0, x[2, 1, 1] = 0, x[2, 2, 1] = 0, y[0, 0] = 0., y[0, 1] = 0., y[1, 1] = 2.]]

I am interested to know if we can isolate any variable value from this solution. I know that Sol[1] will return 8, and Sol[2] will return the remaining terms. But what if I wanted, say, x[1,2,1] alone?

Thanks for reading!

Can somebody please expand the following double sum to produce a list of sequences?

(Sum(f[i], i = 0 .. 1))*(Sum(g[i, j, k], j = 0 .. 1)) for k = {1,2}

I need to make sure the operation order is correct, so I would like to verify my workings.


I wish to apply several i-j constraints to an optimization problem that involves minimizing a function x[i,j]. 

Does anyone know of a simple way to exclude values for i and j? For instance, how do we specify the conditions, i not equal to j, i is not equal to 1, etc.?

Thanks in advance!



Can somebody suggest an efficient way to specify / input a large list of binary variables in the LPSolve command, for example:

> LPSolve(objective function, constraints, binaryvariables={ x[0,0,1], .x[0,0,2], ...., x[i,j,k]}

Is it possible to assign a name to the set rather than input each element, x[i,j,k], manually?

Thanks in advance!

First 8 9 10 11 Page 10 of 11