This Python project is an advanced team maker designed to intelligently distribute participants into teams, considering preferences for specific teammates, thereby enhancing collaboration and satisfaction.
- User Input: Accepts names of participants and desired number of teams.
- Intelligent Team Creation: Distributes participants considering their preferences to maximize the likelihood of pairing with desired teammates.
- Result Saving: Outputs the created team configurations to a text file.
- Run the script
rfs_teamMaker.py
. - Input participant names and type 'done' when finished.
- Specify the desired number of teams.
- Teams are generated with a consideration of user preferences, and results are saved.
The rfs
function employs an adjacency list represented by a Python dictionary (lists
) to manage the participants' preferences. This data structure allows each participant to list their preferred teammates, forming a network of preferences that the algorithm uses to create teams.
Within the rfs
function, the following line plays a crucial role in the team formation process:
for i in random.sample(lists[now], min(random.randint(0, len(lists[now]))+1, len(lists[now]))):
...
- Dynamic Selection: It dynamically selects a subset of the participant's preferred teammates to consider for team assignment. This approach simulates real-life scenarios where preferences impact team formations but must adapt to others' availability and choices.
- Random Sampling: The
random.sample()
function randomly picks preferences, ensuring that the team assignments are influenced by user preferences yet maintain an element of unpredictability. - Flexible Size Handling: The
min(...)
function ensures that the sample size is never larger than the number of available preferences, preventing errors and adapting to the size of the preference list.
The algorithm uses a queue (deque
) to manage the processing of participants in a breadth-first manner, which helps evenly distribute participants across teams according to the structured preferences.
- Python 3.x
- Contact: jjh4450git@gmail.com
- BSD 2-Clause License