Giter VIP home page Giter VIP logo

classroom-scheduling-demo's Introduction

Schedule Generator Demo

Branch-and-Prune Discrete Optimization

Companion blog article can be found here.

YouTube Walkthrough

Abstract

This was an exercise at creating a class schedule generator using branch-and-prune optimization and constraint propogation.

I initially used Kotlin with ojAlgo, which turned out to be effective. However, I found implementing from scratch gave me more control and allowed me to optimize for the specific problem. Both implementations are in this repo.

For now, the model just assumes we are scheduling against one room.

Data Input

Here is the starting data set:

Classrooms:

  1. Psych 101 (1 hour, 2 sessions/week)
  2. English 101 (1.5 hours, 2 sessions/week)
  3. Math 300 (1.5 hours, 2 sessions/week)
  4. Psych 300 (3 hours, 1 session/week)
  5. Calculus I (2 hours, 2 sessions/week)
  6. Linear Algebra I (2 hours, 3 sessions/week)
  7. Sociology 101 (1 hour, 2 sessions/week)
  8. Biology 101 (1 hour, 2 sessions/week)
  9. Supply Chain 300 (2.5 hours, 2 sessions/week)
  10. Orientation 101 (1 hours, 1 session/week)

I set the model to put each recurring session 48 hours apart.

Availability for each day Monday-Friday:

  • 8:00AM-11:30AM
  • 1:00PM-5:00PM

Output

Psych 101- MONDAY/WEDNESDAY 13:00-14:00
English 101- MONDAY/WEDNESDAY/FRIDAY 08:00-09:30
Math 300- MONDAY/WEDNESDAY 14:00-15:30
Psych 300- FRIDAY 13:00-16:00
Calculus I- TUESDAY/THURSDAY 08:00-10:00
Linear Algebra I- MONDAY/WEDNESDAY/FRIDAY 09:30-11:30
Sociology 101- MONDAY/WEDNESDAY 15:30-16:30
Biology 101- TUESDAY/THURSDAY 10:00-11:00
Supply Chain 300- TUESDAY/THURSDAY 13:00-15:30
Orientation 101- TUESDAY 15:30-16:30

Obviously, a room cannot be occupied by more than one class at any time. The solver does this successfully and prevents any overlap in scheduling.

How to Execute

Build the Kotlin project with Gradle, then run the main() function inside the InputAndRun.kt file. You can also change the hardcoded inputs in that file too.

The optimizer should hopefully run in a few seconds and then display the schedule in the console output.

Resources

Coursera Class on Discrete Optimization

classroom-scheduling-demo's People

Contributors

thomasnield avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.