I want to try a method of splitting my students into groups for minor projects to get to know their classmates better.
And then they keep going into different groups until each student has been in a group with every other student at least once.
I want to minimize the number of groupings.
I’m able to code and have some experience with algorithms but this has stumped me.
Groups can be different sizes, but for simplicity let’s say 2.
If there’s a an odd number of students then one will work alone for that project, but I’d prefer to minimize the number of times any student works alone.
I did a sample trial of 6 students in groups of 2 on paper for simplicity.
My method so far:
Rows are a round of groupings.
Columns are each student. (Column 1 is matches for Student 1)
Step 1 is create a zero matrix called MATCH (rows = 5, columns = 6)
Step 2 is populate matches for the first column
MATCH[column 1] =
[
2
3
4
5
6
]
Step 3 is a create a populating function called CHECK that goes through column 2.
If 2 has a previous match, it is placed with the previous match.
After, it pairs with the next non-taken number for that row.
This works fine for column 2.
MATCH[column 2] =
[
1
4
5
6
3]
Column 3 is where I run into trouble.
MATCH[column 3] =
[
0
1
0
0
2
]
The first row would then be populated by 4 with my algorithm, but that would leave the fourth row lacking any matches.
Final matrix should be:
[
215634
341265
456123
564312
632541
]
Does anyone here have any advice to guide me in the right direction?
Or even better if a similar algorithm already exists!
Also, any tips on changing the algorithm if I do groups of 3?
I feel like it's something any decent programmer or mathematician can quickly figure out.
And then they keep going into different groups until each student has been in a group with every other student at least once.
I want to minimize the number of groupings.
I’m able to code and have some experience with algorithms but this has stumped me.
Groups can be different sizes, but for simplicity let’s say 2.
If there’s a an odd number of students then one will work alone for that project, but I’d prefer to minimize the number of times any student works alone.
I did a sample trial of 6 students in groups of 2 on paper for simplicity.
My method so far:
Rows are a round of groupings.
Columns are each student. (Column 1 is matches for Student 1)
Step 1 is create a zero matrix called MATCH (rows = 5, columns = 6)
Step 2 is populate matches for the first column
MATCH[column 1] =
[
2
3
4
5
6
]
Step 3 is a create a populating function called CHECK that goes through column 2.
If 2 has a previous match, it is placed with the previous match.
After, it pairs with the next non-taken number for that row.
This works fine for column 2.
MATCH[column 2] =
[
1
4
5
6
3]
Column 3 is where I run into trouble.
MATCH[column 3] =
[
0
1
0
0
2
]
The first row would then be populated by 4 with my algorithm, but that would leave the fourth row lacking any matches.
Final matrix should be:
[
215634
341265
456123
564312
632541
]
Does anyone here have any advice to guide me in the right direction?
Or even better if a similar algorithm already exists!
Also, any tips on changing the algorithm if I do groups of 3?
I feel like it's something any decent programmer or mathematician can quickly figure out.
