user9272398
user9272398

Reputation:

how I can make two index inequal in ampl?

I know if I want to make 2 index inequal in ampl I have to use the following term:

s.t. b2{s in S, p in P1, j in D1, i in P1, k in D1, r in R:p!=i}

But if I have to make also j!=k what I have to do? I tried the following options but non of them worked!

s.t. b2{s in S, p in P1, j in D1, i in P1, k in D1, r in R:p!=i , j!=k}

s.t. b2{s in S, p in P1, j in D1, i in P1, k in D1, r in R:p!=i : j!=k}

s.t. b2{s in S, p in P1, j in D1, i in P1, k in D1, r in R:p!=i  j!=k}

Upvotes: 0

Views: 34

Answers (1)

LarrySnyder610
LarrySnyder610

Reputation: 2397

You can use and:

b2{s in S, p in P1, j in D1, i in P1, k in D1, r in R : p!=i and j!=k}

Upvotes: 1

Related Questions