Re: Python: How to find out values of all feasible x under constraints.

2015-05-15 Thread Mark Lawrence
On 15/05/2015 13:35, Mark Lawrence wrote: On 15/05/2015 04:58, Xiang Zhang wrote: Dear all, I am writing a code using Python now. I want to know how to find out values of all feasible x under constraints. x = [x_1, x_2, x_3,..., x_10] constraints: x_i = 0,1,2,3 or 4, where i=1,2,..

Re: Python: How to find out values of all feasible x under constraints.

2015-05-15 Thread Mark Lawrence
On 15/05/2015 04:58, Xiang Zhang wrote: Dear all, I am writing a code using Python now. I want to know how to find out values of all feasible x under constraints. x = [x_1, x_2, x_3,..., x_10] constraints: x_i = 0,1,2,3 or 4, where i=1,2,10 x_1 + x_2 + x_3 +...+x_10 <= 15 How t

Re: Python: How to find out values of all feasible x under constraints.

2015-05-15 Thread Peter Otten
Xiang Zhang wrote: > I want to know how to find out values of all feasible x under constraints. > > x = [x_1, x_2, x_3,..., x_10] > > > constraints: > x_i = 0,1,2,3 or 4, where i=1,2,10 > x_1 + x_2 + x_3 +...+x_10 <= 15 That are 5**10 == 9765625 candidates. That's still feasible t

Python: How to find out values of all feasible x under constraints.

2015-05-14 Thread Xiang Zhang
Dear all, I am writing a code using Python now. I want to know how to find out values of all feasible x under constraints. x = [x_1, x_2, x_3,..., x_10] constraints: x_i = 0,1,2,3 or 4, where i=1,2,10 x_1 + x_2 + x_3 +...+x_10 <= 15 How to find out all the feasible solutions x (d