I have 8 groups of people and 4 locations were they can meet. I want 2 groups to meet together at each location once a month. I want each group to meet with one another at some point. I figured out all the possible combinations from 1 to 8 and it adds up to 28 combinations. I would like to make a six month schedule at least, longer if possible. So if I group 1 and 2 meet together in one month then they shouldn't meet together again until they have met with all the other groups.
eg: if group 1 & 2 meet and group 3 & 4 meet and group 5 & 6 meet and group 7 & 8 meet then next month they should all meet with a different. I'm trying to pick these groups randomly. In my code I have 28 combinations, so if group 1 & 2 meet then I wouldn't use the combination of 1 or 2 for the same month because one group can't be in two places at the same time.
So the first month I randomly pick any two groups to meet together from my combination of 1 to 28. How do I eliminate all the possible combinations of 1 & 2 so I don't pick them again and just use the rest of my combinations.
Please excuse the length of this post. Thanks for all your help
wes
CODE
a = "1/2" : b = "2/3" : c = "3/4" : d = "4/5" : e1 = "5/6" : f = "6/7" : g = "7/8" : h = "1/3" : i = "2/4"
j = "3/5" : k = "4/6" : l = "5/7" : m = "6/8" : n = "1/4" : o = "2/5" : p = "3/6" : q = "4/7" : r = "5/8"
s = "1/5" : t = "2/6" : u = "3/7" : v = "4/8" : w = "1/6" : x = "2/7" : y = "3/8" : z = "1/7" : aa = "1/8"
bb = "2/8"
'''' generating list for Jan
jan1 = "" : jan2 = "" : jan3 = "" : jan4 = ""
kk = "" : jj = "" : ii = 0
Do
dupes = False
kk = Int(Rnd() * 28) + 1
kk = kk + 96
jj = Chr(kk)
If jj = "a" Then
jan1 = "1/2"
ElseIf jj = "b" Then
jan1 = "2/3"
ElseIf jj = "c" Then
jan1 = "3/4"
ElseIf jj = "d" Then
jan1 = "4/5"
ElseIf jj = "e" Then
jan1 = "5/6"
ElseIf jj = "f" Then
jan1 = "6/7"
ElseIf jj = g Then
jan1 = "7/8"
ElseIf jj = "h" Then
jan1 = "1/3"
ElseIf jj = "i" Then
jan1 = "2/4"
ElseIf jj = "j" Then
jan1 = "3/5"
ElseIf jj = "k" Then
jan1 = "4/6"
ElseIf jj = "l" Then
jan1 = "5/7"
ElseIf jj = "m" Then
jan1 = "6/8"
ElseIf jj = "n" Then
jan1 = "1/4"
ElseIf jj = "o" Then
jan1 = "2/5"
ElseIf jj = "p" Then
jan1 = "3/6"
ElseIf jj = "q" Then
jan1 = "4/7"
ElseIf jj = "r" Then
jan1 = "5/8"
ElseIf jj = "s" Then
jan1 = "1/5"
ElseIf jj = "t" Then
jan1 = "2/6"
ElseIf jj = "u" Then
jan1 = "3/7"
ElseIf jj = "v" Then
jan1 = "4/8"
ElseIf jj = "w" Then
jan1 = "1/6"
ElseIf jj = "x" Then
jan1 = "2/7"
ElseIf jj = "y" Then
jan1 = "3/8"
ElseIf jj = "z" Then
jan1 = "1/7"
ElseIf jj = "{" Then
jan1 = "1/8"
ElseIf jj = "|" Then
jan1 = "2/8"
End If
Loop Until dupes = False
This post has been edited by PsychoCoder: 31 Jan, 2008 - 08:48 AM