Syntax formulation for an excluded term in a set

classic Classic list List threaded Threaded
2 messages Options
bcc
Reply | Threaded
Open this post in threaded view
|

Syntax formulation for an excluded term in a set

bcc
Hi,

I have a problem on formulating an excluded term.
1. Given the following expression:
             ωijj’ ≤ τijj’ ∀i∈ B,  j,j’∈ V

where j' indicates any other number not used in the set, how do I formulate the AMPL expression (especially those in bold)? In another words, in the declaration of variables and constraint, how do I include the j' ?

(a) var ω{1..B,1..V,1..V}

(b) c1: {i in 1..I,j in 1..J}: w[i,j.j]<=t[i,j,j];


2. Another question is how to formulate the following expression where the
subscript' has become a variable (in bold)?

              ∑kєU  {k *xijk} ≥ ∑k’єU {k’ *xij’k’} + (τijj’ – 1) TM   ∀i∈ B,  j,j’ ∈ V

(a) Must I declare a new variable k?


Thanks in advance

Regards,
-bcc
Reply | Threaded
Open this post in threaded view
|

[AMPL 2110] Re: Syntax formulation for an excluded term in a set

Robert Fourer-2


> ωijj’ ≤ τijj’  for all i in B, j,j’ in V

param B integer > 0;
param V integer > 0;
param tau {1..B,1..V,1..V} >= 0;
var Omega {1..B,1..V,1..V} >= 0;

subj to c1 {i in 1..B, j in 1..V, jprime in 1..V}:
   Omega[i,j,jprime] <= tau[i,j,jprime];

> ∑kєU {k *xijk} ≥ ∑k’єU {k’ *xij’k’} + (τijj’ – 1)
>    for all i in B,  j,j' in V

subj to c2 {i in 1..B, j in 1..V, jprime in 1..V: j <> jprime}:
   sum {k in U} k * x[i,j,k] >=
   sum {k in U} k * x[i,jprime,k] + tau[i,j,jprime] - 1;

You can use the same index "k" in both sums.

Bob Fourer
[hidden email]


> -----Original Message-----
> From: [hidden email] [mailto:[hidden email]] On Behalf Of bcc
> Sent: Saturday, November 29, 2008 11:09 AM
> To: [hidden email]
> Subject: [AMPL 2105] Syntax formulation for an excluded term in a set
>
>
> Hi,
>
> I have a problem on formulating an excluded term.
> 1. Given the following expression:
>              ωijj’ ≤ τijj’ ∀i∈ B,  j,j’∈ V
>
> where j' indicates any other number not used in the set, how do I formulate
> the AMPL expression (especially those in bold)? In another words, in the
> declaration of variables and constraint, how do I include the j' ?
>
> (a) var ω{1..B,1..V,1..V}
>
> (b) c1: {i in 1..I,j in 1..J}: w[i,j.j]<=t[i,j,j];
>
>
> 2. Another question is how to formulate the following expression where the
> subscript' has become a variable (in bold)?
>
>               ∑kєU  {k *xijk} ≥ ∑k’єU {k’ *xij’k’} + (τijj’ – 1) TM   ∀i∈
> B,  j,j’ ∈ V
>
> (a) Must I declare a new variable k?
>
>
> Thanks in advance
>
> Regards,
> -bcc
> --
> View this message in context: http://www.nabble.com/Syntax-formulation-for-
> an-excluded-term-in-a-set-tp20749133p20749133.html
> Sent from the AMPL mailing list archive at Nabble.com.
>
>
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "AMPL Modeling Language" group.
To post to this group, send email to [hidden email]
To unsubscribe from this group, send email to [hidden email]
For more options, visit this group at http://groups.google.com/group/ampl?hl=en
-~----------~----~----~----~------~----~------~--~---