I’m not a package author, but I use JuMP a lot and recently held a mini-course in Julia & JuMP for PhD students focused on energy systems modeling. As a first introduction to JuMP I used my rewritten version of a multicommodity transport problem from the JuMP Github repo. Most of it could fit on two slides of about 20 lines each if you can accept a smallish font size. Something like this:
Slide 1 (“sets” and parameters). The point is to show that JuMP is just ordinary Julia.
# index sets
ORIG = [:gary, :clev, :pitt]
DEST = [:fra, :det, :lan, :win, :stl, :fre, :laf]
PROD = [:bands, :coils, :plate]
# supply(PROD, ORIG) amounts available at origins
supplytable = [
:_ :gary :clev :pitt
:bands 400 700 800
:coils 800 1600 1800
:plate 200 300 300
]
supply = readtable(supplytable)
# demand(PROD, DEST) amounts required at destinations
demandtable = [
:_ :fra :det :lan :win :stl :fre :laf
:bands 300 300 100 75 650 225 250
:coils 500 750 400 250 950 850 500
:plate 100 100 0 50 200 100 250
]
demand = readtable(demandtable)
Slide 2 (the JuMP model):
multi = Model(solver=ClpSolver()) # or CbcSolver() or GLPKSolverLP()
@variables multi begin
Trans[p in PROD, o in ORIG, d in DEST] >= 0
end
# Changed constraints to inequalities.
@constraints multi begin
c_supply[p in PROD, o in ORIG],
sum(Trans[p,o,d] for d in DEST) <= supply[p,o]
c_demand[p in PROD, d in DEST],
sum(Trans[p,o,d] for o in ORIG) >= demand[p,d]
c_total_shipment[o in ORIG, d in DEST],
sum(Trans[p,o,d] for p in PROD) <= limit[o,d]
end
# For some reason the original file cost maximizes. Changed to cost minimization.
@objective multi Min begin
sum(cost[p,o,d] * Trans[p,o,d] for p in PROD, o in ORIG, d in DEST)
end
status = solve(multi)
Alternatively, make one slide where you explain what JuMP is and just use my second slide. Delete the comments to make it a bit shorter.
It’s possible to make a complete JuMP demo in just a few lines, but that would just look like a clunkier version of the matrix-based optimization solvers of Matlab. To get a taste of why JuMP is so great for formulating and solving large constrained optimization problems I think this is the smallest useful example size.
Oh, another reason for showing a JuMP slide is that it’s a great demo of how Julia’s macro system makes high level magic possible.
Download the complete executable source code here (note you need Julia 0.6 since JuMP doesn’t have official 1.0 support yet).
EDIT: Sorry, somehow I completely missed that your main criteria were “short to express” and “impressive in conciseness”. My example hardly fits the bill then. Oh well, at least it’s “easy to understand for informed non-specialists”.