Skip to content

Instantly share code, notes, and snippets.

@hbshrestha
Created September 22, 2021 14:20
Show Gist options
  • Save hbshrestha/12b9dffb3445ef46ae4a9c8f6076fffc to your computer and use it in GitHub Desktop.
Save hbshrestha/12b9dffb3445ef46ae4a9c8f6076fffc to your computer and use it in GitHub Desktop.
using LinearAlgebra
using JuMP
using GLPK
using Plots
pyplot()
model = Model()
set_optimizer(model, GLPK.Optimizer)
#Define variables
@variable(model, x>=0)
@variable(model, y>=0)
#Define Constraints
@constraint(model, 3x+2y<=66)
@constraint(model, 9x+4y<=180)
@constraint(model, 2x+10y<=200)
#Define Objective
@objective(model, Max, 90x+75y)
#Run the opimization
optimize!(model)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment