|
From: | Benson |
Subject: | [Help-glpk] set of sets |
Date: | Wed, 28 May 2008 05:24:55 +0400 |
Hello, I am writing a timetabling program in GMPL and I #39;d like to write some incompatibility constraints of courses generally, e.g. I want to say that no more than 1 of {A1, A2, A3} can appear in the same slot, and no more than 1 of {B1, B2} can appear in the same slot something like.. set incompatitible := (A1, A2, A3) (B1, B2); min..... s.t. no_incomp{s in SLOTS}: sum{s in SLOTS, i in incomp} allocation[slot, course in i] <= 1; /* allocation is binary decision variable Question: 1. Can I even have a set of sets of different size? 2. How can I express the above? I have read the manual for quite a while but I can #39;t seem to find something similar. I #39;d appreciate if you can point to the right direction. Kind Regards, Benson H
I am writing a timetabling program in GMPL and I'd like to write some incompatibility constraints of courses generally, e.g. I want to say that no more than 1 of {A1, A2, A3} can appear in the same slot, and no more than 1 of {B1, B2} can appear in the same slot
something like..
set incompatitible := (A1, A2, A3) (B1, B2);
min.....
s.t. no_incomp{s in SLOTS}: sum{s in SLOTS, i in incomp} allocation[slot, course in i] <= 1; /* allocation is binary decision variable
Question:
1. Can I even have a set of sets of different size?
2. How can I express the above?
I have read the manual for quite a while but I can't seem to find something similar. I'd appreciate if you can point to the right direction.
Kind Regards,
Benson H
[Prev in Thread] | Current Thread | [Next in Thread] |