AMPL offers superior support by our development and technical support teams.
Contact us for general queries, partnerships, and more.
We can help you find the license and offering that works best for your situation.
SUPPORT
AMPL is now on Discourse! 🎉
This is your NEW best place to talk about optimization problems, and get support for AMPL and AMPL Community Edition from our dev team and the community.
Join the conversation at discuss.ampl.com
SUPPORT
AMPL is now on Discourse! 🎉
This is your NEW best place to talk about optimization problems, and get support for AMPL and AMPL Community Edition from our dev team and the community.
Join the conversation at discuss.ampl.com
SOLVER UPDATES
All-new Gurobi 10 solver driver for AMPL!
Featuring a new network simplex algorithm, significant performance gains on MIPs, and more!
Our enhanced Gurobi driver (previously x-gurobi) is now the default gurobi driver.
AMPL offers superior support by our development and technical support teams.
Contact us for general queries, partnerships, and more.
We can help you find the license and offering that works best for your situation.
# ----------------------------------------
# LOCATION-TRANSPORTATION PROBLEM
# ----------------------------------------
set ORIG; # shipment origins (warehouses)
set DEST; # shipment destinations (stores)
param supply {ORIG} > 0;
param demand {DEST} > 0;
var Build {ORIG} binary; # 1 iff it is built
param fix_cost {ORIG} > 0;
var Ship {ORIG,DEST} >= 0; # amounts shipped
param var_cost {ORIG,DEST} > 0;
minimize Total_Cost:
sum {i in ORIG} fix_cost[i] * Build[i] +
sum {i in ORIG, j in DEST} var_cost[i,j] * Ship[i,j];
subj to Supply {i in ORIG}:
sum {j in DEST} Ship[i,j] <= supply[i] * Build[i];
subj to Demand {j in DEST}:
sum {i in ORIG} Ship[i,j] = demand[j];