-1

I am looking for some guidance on making an algorithm. My scenario is described below.


Scenario

I have N teams and M rooms and want to create a weekly schedule that suits all the N teams based on some criteria.

Each of the N teams looks as follows:

  1. Size (int): The amount members in the team.
  2. Sessions (int): The number of sessions that the team needs a room for. Each lasting one hour.
  3. Consecutive (bool): Indicates whether a team is able to have sessions on consecutive days or not.

The following conditions must also be considered:

  1. If a team's size is below a certain threshold T, a room can be split in half for them to use, which possibly frees up the other half for another team's session.
  2. If it is not possible to meet all teams' criteria, the algorithm should relax the criteria to find a schedule that breaks the criteria as little as possible.

Future conditions would be to include team availability for those that must or can't practice at specific times. Though, I am just looking for a simple starting point at the moment.


My initial thoughts were a dynamic programming algorithm while a quick chat with ChatGPT brought up the constraint satisfaction algorithm. Does any of you see a solution to this problem and how it can be modeled?

bragi
  • 183
  • 2
  • 12

1 Answers1

0

Defining it as a "constraint satisfaction problem" (CSP) and then use one of the many CSP-solvers out there seams a good idea. For small N, M you could also program it yourself using backtracking,

A smart way of relaxing the criteria could be a bit challenging to implement. (In the simplest case relax and search again until you find a solution)

MrSmith42
  • 9,961
  • 6
  • 38
  • 49