highs (35 notebooks)#

AMPL - solve multiple models in parallel#

multiproc.ipynb Open In Colab Kaggle Gradient Open In SageMaker Studio Lab
Description: Solve multiple AMPL models in parallel in Python with amplpy and the multiprocessing modules.

AMPL - spreadsheet handling with amplxl#

amplxl.ipynb Open In Colab Kaggle Gradient Open In SageMaker Studio Lab
Description: Basic example of reading/writing data into/from a .xlsx spreadsheet with amplxl

AMPL Bin Packing Problem with GCG#

bpp.ipynb Open In Colab Kaggle Gradient Open In SageMaker Studio Lab
Description: Dantzig-Wolfe decomposition for Bin Packing Problem with GCG

AMPL Christmas Model created by ChatGPT#

AMPL Model Colaboratory Template#

colab.ipynb Open In Colab Kaggle Gradient Open In SageMaker Studio Lab
Description: Basic notebook template for the AMPL Colab repository

Aircrew trainee scheduling with seniority constraints#

CP-style scheduling model with the numberof operator, solved by a MIP solver#

sched_numberof.ipynb Open In Colab Kaggle Gradient Open In SageMaker Studio Lab
Description: Scheduling model with the Constraint Programming numberof operator, solved with a MIP solver. New MIP solver drivers based on the [MP library](https://amplmp.readthedocs.io/) enable CP-style modeling.

Containers scheduling#

containers_scheduling.ipynb Open In Colab Kaggle Gradient Open In SageMaker Studio Lab
Description: Scheduling model for harbor operations. It is a problem with dependences between containers, which should be dispatch the fastest possible. We are using the MP solver interfaces to model a complex system using techniques from Constraint Programming, such as indicator constraints, and logical or and forall operators. After the model is written, a couple instances are presented and Highs/Gurobi MIP solvers are used to tackle the problem.

Dual-Donor Organ Exchange problem#

Dual-Donor_Organ_Exchange.ipynb Open In Colab Kaggle Gradient Open In SageMaker Studio Lab
Description: Most transplants from living donors require only one donor for each procedure. There are, however, exceptions, including dual-graft liver transplantation, bilateral living-donor lobar lung transplantation, and simultaneous liver-kidney transplantation. For each of these procedures, grafts from two compatible living donors are transplanted. As such, these procedures are more involved from an organizational perspective than those with only one donor. Unfortunately, one or both of the donors can often be biologically incompatible with the intended recipient, precluding the transplantation.

Dynamic routing example#

Dynamic_routing_example.ipynb Open In Colab Kaggle Gradient Open In SageMaker Studio Lab
Description: Example of interactive optimization with GUI using AMPL and Google Maps
Tags: amplpy, gui

Employee Scheduling Optimization#

Employee_Scheduling.ipynb Open In Colab Kaggle Gradient Open In SageMaker Studio Lab
Description: Employee scheduling model from the Analytical Decision Modeling course at the Arizona State University.

Hospitals-Residents MIP#

hospitals_residents.ipynb Open In Colab Kaggle Gradient Open In SageMaker Studio Lab
Description: hospitals-residents problem with ties problem solved with ampl and highs

Labs scheduling#

labs_scheduling.ipynb Open In Colab Kaggle Gradient Open In SageMaker Studio Lab
Description: Model for laboratories scheduling. Some labs are needed to handle requests from researchers, and departments have to assign labs and locations to the requests.

N-Queens#

nqueens.ipynb Open In Colab Kaggle Gradient Open In SageMaker Studio Lab
Description: How can N queens be placed on an NxN chessboard so that no two of them attack each other?

Network design with redundancy#

electric_grid_with_redundancy.ipynb Open In Colab Kaggle Gradient Open In SageMaker Studio Lab
Description: Design of an electricity transportation network provides enough redundancy, so that a break of one component does not prevent any user from receiving electricity. The approach also works for similar distribution networks and can potentially be used in the design of military logistic networks.

Oil refinery production optimization#

oil_refining.ipynb Open In Colab Kaggle Gradient Open In SageMaker Studio Lab
Description: In this document, we present an enhanced approach to oil refining optimization for improved decision-making.

Oil refinery production optimization (+PowerBI)#

oil_refining_powerbi.ipynb Open In Colab
Description: In this document, we present an enhanced approach to oil refining optimization by integrating Power BI for improved decision-making and data visualization. For a full description of the model, you can read more about it [here](ampl/colab.ampl.com).

Oil refinery production optimization (ampl-only version)#

oil_refining_ampl_only.ipynb Open In Colab Kaggle Gradient Open In SageMaker Studio Lab
Description: In this document, we present an enhanced approach to oil refining optimization for improved decision-making.

Optimal Power Flow with AMPL and Python - DC Power Flow#

Optimization of Reinforced Concrete Production and Shipment: A Conveyor-Based Manufacturing and Curing Model#

Optimizing the number of staff in a chain of stores#

Plot feasible region#

plot_feasible_region.ipynb Open In Colab Kaggle Gradient Open In SageMaker Studio Lab
Description: Plot the feasible region and optimal solution for a simple two variable model using AMPL’s Python API.
Tags: lecture, lp, simple

Profit Maximization for Developers: Optimizing Pricing, Marketing, and Investment Strategies#

Project management: Minimizing the cost of implementing an investment project, taking into account the costs and risks of completing tasks and penalties for late fulfillment of obligations.#

Quick Start using Pandas dataframes#

pandasdiet.ipynb Open In Colab Kaggle Gradient Open In SageMaker Studio Lab
Description: Quick Start using Pandas dataframes to load and retrieve data

Quick Start using lists and dictionaries#

nativediet.ipynb Open In Colab Kaggle Gradient Open In SageMaker Studio Lab
Description: Quick Start using lists and dictionaries to load and retrieve data

Scheduling Multipurpose Batch Processes using State-Task Networks in Python#

batch_processessing.ipynb Open In Colab Kaggle Gradient Open In SageMaker Studio Lab
Description: The State-Task Network (STN) is an approach to modeling multipurpose batch process for the purpose of short term scheduling. It was first developed by Kondili, et al., in 1993, and subsequently developed and extended by others.

Simple sudoku solver using logical constraints (with GUI)#

sudoku.ipynb Open In Colab Kaggle Gradient Open In SageMaker Studio Lab
Description: Simple sudoku model with two formulations: as a Constraint Programming problem using the alldiff operator and as a MIP. Note that the CP formulation is more natural but it needs a solver supporting logical constraints or a MIP solver with automatic reformulation support (see [here](https://mp.ampl.com/) for more information).

Solution check: discontinuous objective function#

sol-check.ipynb Open In Colab Kaggle Gradient Open In SageMaker Studio Lab
Description: Pathological examples to illustrate MP solution checker and settings

Solving a nonogram puzzle#

nonogram.ipynb Open In Colab Kaggle Gradient Open In SageMaker Studio Lab
Description: Model for solving nonogram puzzles autogenerated using nonogram.mod, nonogram.dat and nonogram.run.
Tags: ampl-only, mip

Solving simple stochastic optimization problems with AMPL#

newsvendor.ipynb Open In Colab Kaggle Gradient Open In SageMaker Studio Lab
Description: Examples of the Sample Average Approximation method and risk measures in AMPL

Sudoku Generator#

sudoku_gen.ipynb Open In Colab Kaggle Gradient Open In SageMaker Studio Lab
Description: Generate Sudoku boards with unique solution via iterative method and mip formulation.

Unit Commitment for Electrical Power Generation#

unit_commitment.ipynb Open In Colab Kaggle Gradient Open In SageMaker Studio Lab
Description: This notebook illustrates the power generation problem using AMPL. The original version featured the Gurobi solver. By default, this notebook uses the HiGHS and CBC solvers.

VPSolver: Cutting & Packing Problems#

vpsolver.ipynb Open In Colab Kaggle Gradient Open In SageMaker Studio Lab
Description: Solving cutting & packing problems using arc-flow formulations

Warehouse location and transport#

warehouse_location.ipynb Open In Colab Kaggle Gradient Open In SageMaker Studio Lab
Description: Model for warehouse allocation. Farms (suppliers) send feedstock to warehouses, and later on, those warehouses send it to a production plant. The problem involves modeling a storage facility location problem with a transportation component to the final plant.