Red Huq
Red Huq
Sep 3, 2018 · 1 min read

The most “fair” way to solve a electives allocation problem is using combinatorial optimization, specifically integer programming. You’d like to maximize the rankings with constraints: a) each elective has a limited number of seats and b) each student is assigned to 3 electives.

Your algorithm is a good start but uses a greedy approach that will lead to a local optimum. Check out the cvxpy package and this great intro to convex optimization https://developers.google.com/optimization/assignment/simple assignment.

    Red Huq

    Written by

    Red Huq

    Data scientist 🤖 | Gastronome 🍜 | Board gamer 🎲 | Brooklynite 🌃