Skip to content

A Java program that places a population of "students" (unique names) into sets and groups, with no student sharing a group with one another more than once.

Notifications You must be signed in to change notification settings

tannercroom/istm325-group-formations

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 

Repository files navigation

ISTM 325 - Group Formations

One of the assignments in the ISTM 325 course I took in Spring 2022 required me to create a program that can properly create groups and group sets of "students" (unique names), with the following requirements:

  • No student is repeated in the same group.
  • No student shares a group with another student more than once, including across group sets.

This logic problem is reminiscent of Kirkman's schoolgirl problem, the social golfer problem, and other similar combinatorial-design problems.

The detailed instructions for how the program should function are as follows:

  1. Read in a specified number of unique students via a pre-formatted CSV file.
  2. Prompt the user for the number of students in each group.
  3. Prompt the user for the number of group sets that should be created.
  4. Notify the user if the number of groups or sets is unable to be created.
  5. Output a formatted CSV file with the groups and sets.

How to Run This Program

This Java program can be compiled and run in any Java Runtime Environment (JRE) the user chooses. After downloading the program, extract all files in "GroupFormations.zip" to a single location, and run groupFormations.java in your preferred environment. This program has no GUI, and is fully executed through the console.

I. Define the student population in which to create groups.

Enter the full filename of the pre-formatted CSV file of unique students you would like the program to use. The list should contain individual, unique names to adaqautely identify each student. The number of students the program reads in is defined by the integer at the beginning of the CSV file. When the program is compiled and run in the JRE of your choice, the program requests the user to enter the filename of the CSV file they would like to use.

Note: The file "names.csv" is included as an example and can be used when running this program.

II. Define the number of students to be placed in each group.

Once the students have been read in to memory, the program asks the user to specify the number students to place in each group. The user must enter a valid integer to continue.

III. Define the number of group sets to be created.

The program then asks the user to specify the number of group sets to be created. The user must enter a valid integer to continue. If the program cannot create the number of groups or sets required after 1,500,000 failed attempts, a message will be displayed detailing "The specified number of sets was unable to be created due to the constraint of no two students co-occurring in the same group more then once."

IV. View outputted groups and sets in designated formatted CSV file.

Once the program has completed creating groups and sets, an output file will be automatically generated with the filename "sets-[yyyy-MM-dd_HHmmss].csv" in the same location all program files reside.

Note: if the program was unable to create the specified number of sets, an output file will still be generated with what the program was able to come up with before reaching 1,500,000 failed attempts.

About

A Java program that places a population of "students" (unique names) into sets and groups, with no student sharing a group with one another more than once.

Topics

Resources

Stars

Watchers

Forks

Languages