math - Cplex constraint for 2 dimensional binary decision variables -


i need solve problem decision variables binary , 2 dimensional matrix, in cplex y[p][q], p , q both have same range papers=1..78. need incorporate constraint restricts sum of both row , column smaller or equal 1. ex. sum of row 32 , column 32 can smaller or equal 1.

therefore made constraint this:

forall(p in papers) sum (q in papers) y[p][q] + y[q][p] <= 1;

cplex gives error @ second 'q': name "q" not exist

i don't know i'm doing wrong, appreciate help.

thanks in advance!

from memory, sum(q in papers) applies immediate following term. try putting 2 separate parts in parentheses, like:

forall(p in papers) sum (q in papers) ( y[p][q] + y[q][p] ) <= 1; 

Comments

Popular posts from this blog

jquery - How do you format the date used in the popover widget title of FullCalendar? -

asp.net mvc - SSO between MVCForum and Umbraco7 -

Python Tkinter keyboard using bind -