AMPL on Google Colab
AMPL Model Colaboratory is a collection of AMPL models in Jupyter Notebooks
that run on platforms such as Google Colab, Kaggle, Gradient, and AWS SageMaker.
In order to be use AMPL on these notebook platforms you just need to following two code blocks
at the beginning of your notebook:
# Install dependencies
%pip install -q amplpy
# Google Colab & Kaggle integration
from amplpy import AMPL, ampl_notebook
ampl = ampl_notebook(
modules=["gurobi", "coin", "highs", "gokestrel"], # modules to install
license_uuid="default") # license to use
In the list MODULES
you can specify the AMPL solvers you want to use in your notebook.
Full list of AMPL modules available: amplgsl
, baron
, cbc
, coin
, conopt
, copt
, cplex
, gcg
, gecode
, gokestrel
, gurobi
, highs
, ilogcp
, knitro
, lgo
, lindoglobal
, loqo
, minos
, mosek
, octeract
, open
, plugins
, scip
, snopt
, xpress
.
[AMPL Model Colaboratory] [N-Queens notebook] [https://try.ampl.com]
You can use the Christmas notebook written by ChatGPT to get started:
BTW: you can even ask
ChatGPT to write models for you! If it makes mistakes you can ask for help in our new
Support Forum!