title: Cplex constraint for 2 dimensional binary decision variables
body: <p>I need to solve a problem where my decision variables are binary and are a 2 dimensional matrix, in Cplex y[p][q], p and q both have the same range papers=1..78. I need to incorporate a constraint that restricts the sum of both a row and column to be smaller or equal to 1. For ex. the sum of row 32 and column 32 can only be smaller or equal than 1.</p>
  
  <p>Therefore I made a constraint like this:</p>
  
  <p>forall(p in papers)
  sum (q in papers)
  y[p][q] + y[<strong>q</strong>][p] &lt;= 1;</p>
  
  <p>Cplex gives an error at the second 'q': name "q" does not exist </p>
  
  <p>I don't really know what I'm doing wrong, I would appreciate the help.</p>
  
  <p>Thanks in advance!</p>