Skip to content

Instantly share code, notes, and snippets.

View ardestyanto's full-sized avatar

Arry Rahmawan Destyanto ardestyanto

  • Delft University of Technology
View GitHub Profile
@ardestyanto
ardestyanto / MILP_python.py
Created January 5, 2022 21:02
Example code for solving a simple mixed-integer linear programming problem using Python and Gurobi Solver
import pyomo.environ as pyo
from pyomo.environ import *
from pyomo.opt import SolverFactory
#mathematicalmodeling
model = pyo.ConcreteModel()
model.x = pyo.Var(range(1,6), within=Integers, bounds=(0,None))
model.y = pyo.Var(bounds=(0,None))