ScPo-CompEcon / CourseMatch-archive.jl

CourseMatch implementation at ScPo
Other
1 stars 12 forks source link

Define Course Demand function d(p) -> demand for each course #4

Closed floswald closed 6 years ago

floswald commented 6 years ago

outline

tasks

Gegas2231 commented 6 years ago

The maximization strategy will have to look over all possible allocation of courses for each student since is a discrete choice problem. We can greatly reduce this set of feasible courses per student taking into account the program structure provided by each school. This structure includes mandatory courses per semester and pre-requisites.

The first step should be to obtain this feasible sets to input this to the maximization problem. An issue that arises, similar to the preference structure, is how we get the program structure in order to get the feasible set.

mdesevricourt commented 6 years ago

One way to think about that would be to have a list of all the possible types of requirements Sciences Po programs ask: -some programs require that their students take a specific course, i. e. this course is compulsory for all the students in the program -some programs require that at least n courses be chosen from a set of courses, i. e. some programs require students to choose 2 courses among the "cours électifs" -most programs (probably all) require that students enroll for at least X credits each semester I think we can gain clarity if we think about all the types of requirements. Do you all have any other types of requirements in mind?

floswald commented 6 years ago

here is a hint for everybody working on this issue. we didn't have time to cover it in our section on optimization, but this can be seen as a type of knapsack problem. page 32 of this course handout. https://scpo-compecon.github.io/CoursePack/Pdfs/optimization2.pdf

I'll add the label up for grabs now, because with that info you should be able to shoot this issue down in a matter of hours. waiting for my first pull request! ⏰

Gegas2231 commented 6 years ago

Taking the data structure for preferences that is mentioned in the respective issue. We have a relatively easy problem to solve. I propose the following simple code as example, is easy to scale this code to a more general context.

using JuMP, Gurobi

m = Model(solver = GurobiSolver())

@variable(m, x[1:3], Bin)

utility = [80 10 -50; 10 90 0; -50 0 60]
price = [20, 30, 15]
budget = 50

@objective(m, Max, x'*utility*x)

#profit = [10 20 30]

@constraint(m, price'*x <= budget)

status = solve(m)

for i in 1:3
    println("x[$i] = ", getvalue(x[i]))
end

I did not know what to use so I went with Gurobi, but there are probably other solvers that can handle quadratic mixed-interger optimization. My solution assumes this functional form for the preferences, so it kinda tackles two issues at once, but not sure if it is the best solution.

floswald commented 6 years ago

this is almost ready to be closed. we are waiting for @JulieLen to make a few changes to her pull request, after which she can close this issue. well done!

JulieLen commented 6 years ago

Function updated !