gams beginner

Problems with syntax of GAMS
Post Reply
YCF0913
User
User
Posts: 3
Joined: 6 years ago

gams beginner

Post 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?
User avatar
Renger
Posts: 639
Joined: 7 years ago

Re: gams beginner

Post 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
____________________________________
Enjoy modeling even more: Read my blog on modeling at The lazy economist
Post Reply