Page 1 of 1

gams beginner

Posted: Thu Mar 01, 2018 4:04 pm
by YCF0913
Hi,
I'm going to divide 6 into 5 non-negative integers that are less than or equal to 2.
Forexample, 6=0+0+1+2+3 ,1+2+3+0+0 ,6=2+2+2+0+0, 6=1+2+2+1+0 and so on.
How can I get all possible answer by gams?

Re: gams beginner

Posted: Fri Mar 02, 2018 7:53 am
by Renger
Hi

You can find here partitioning algorithms in several other programming languages. Up to you to try to implement it in Gams

https://stackoverflow.com/questions/400 ... f-a-number

Cheers
Renger