My AMPL page
AMPL is a mathematical programming system supporting
linear programming, nonlinear programming, and (mixed) integer programming. From the site:
AMPL is a comprehensive and powerful algebraic modeling language for linear and nonlinear optimization problems, in discrete or continuous variables.
Developed at Bell Laboratories, AMPL lets you use common notation and familiar concepts to formulate optimization models and examine solutions, while the computer manages communication with an appropriate solver.
AMPL's flexibility and convenience render it ideal for rapid prototyping and model development, while its speed and control options make it an especially efficient choice for repeated production runs.
See also
Note: In 2007/2008 I wrote quite a few AMPL models without the logic/CP extension. See My AMPL models (non CP) below for a listing of these non CP models.
In 2013 I tested this logical/CP extensions much more. It requires either gecode or ilogcp solvers; see the AMPL page "Logic" and Constraint Programming Extensions for details. These models are listed in My AMPL+CP models just below.
My AMPL+CP models
April/May 2013: Here is a list of AMPL models which use the "Logic" and Constraint Programming Extensions to AMPL. I have mostly tested the Gecode CP solver in AMPL, but also the IBM ILOG CP ilogcp solver. See code.google.com/p/ampl/ for gecode executables (to be used as an AMPL solver) and github.com/vitaut/ampl for source code. Also some models not using any logic/CP extensions was made and they are marked as "not CP". Many of these models has been ported from my MiniZinc models.
- a_puzzle.mod: "A puzzle" (8809 = 6, ....)
- a_round_of_golf.mod: A Round of Golf (Dell Logic Puzzles)
- all_interval.mod: All interval problem (series), (CSPLib problem 7)
- alldifferent_except_0.mod: "Decomposition" of global constraint
alldifferent_except_0
- appointment_scheduling.mod: Appointment scheduling (Stack Overflow)
- arch_friends.mod: Arch Friends (Dell Logic Puzzles)
- baby_sitting.mod: Baby Sitting (Dell Logic Puzzles)
- bales_of_hay.mod: Bales of hay puzzle
- breaking_news.mod: Breaking News (Dell Logic Puzzles)
- broken_weights.mod: Broken weights problem
- building_blocks.mod: Building blocks puzzle (Dell Logic Puzzles). See labeled_dice3.mod below for a general model.
- calculs_d_enfer.mod: Calculs d'enfer puzzle (from the NCL manual)
- car.mod: Car sequencing (OPL)
Data files:
- circling_squares.mod: Circling squares puzzle (Dudeney)
- circuit.mod: "Decomposition" of global constraint
circuit
(also the path)
- clock_triplets.mod: Clock Triplets problem (Dean Clark, Martin Gardner)
- coin_change.mod: Coins change problem
- combinatorial_auction.mod: Combinatorial Auction
Data files:
- costas_array.mod: Costas Array
- crew.mod: Crew allocation problem
- crypta.mod: Cryptarithmetic puzzle
- crypto.mod: Cryptarithmetic puzzle
- cur_num.mod: Curious numbers (Dudeney)
- devils_word.mod: Devil's word (c.f. Devil's word CGI program)
- divisible_by_9_through_1.mod: Divisible by base through 1 (for bases 2.. 10: mod 2 = 0)
- dudeney_numbers.mod: Dudeney numbers
- einav_puzzle.mod: Einav puzzle (from A programming puzzle from Einav)
- eq10.mod: Eq 10 (standard benchmark)
- eq20.mod: Eq 20 (standard benchmark)
- fancy.mod: Mr Greenguest puzzle ("fancy dress" problem)
- finding_celebrities.mod: Finding celebrities at a party (Uwe Hoffmann)
Data files:
- five_floors.mod: Five floors problem (Alexey Radul & Gerald Jay Sussman: "The Art of Propagator")
- fractions.mod: Fractions (Prolog benchmark, B-Prolog)
- futoshiki.mod: Futoshiki grid puzzle
Data files:
- four_islands.mod: Four Islands (Dell Logic Puzzle)
- general_store.mod: General Store problem (Sam Loyd)
- global_contiguity2.mod: "Decomposition" of global constraint
global contiguity
- golomb.mod: Golomb ruler problem (CSPLib #6)
- grocery.mod: Grocery problem (Oz)
- hamming_distance.mod: Hamming distance
- handshaking.mod: Halmos' handshaking problem
- heterosquare.mod: Heterosquare grid
- hidato.mod: Hidato puzzle
Data files:
- huey_dewey_louie.mod: Huey, Dewey, and Louie problem (Marriott & Stuckey "Programming with Constraints")
- isbn.mod: Some exploration of ISBN13
- jobs_puzzle.mod: Jobs puzzle (logical puzzle)
- just_forgotten.mod: Just forgotten puzzle (Enigma 1517)
- kakuro2.mod: Kakuro grid puzzle
- killer_sudoku.mod: Killer Sudoku
- labeled_dice.mod: Labeled dice
- labeled_dice2.mod: Labeled dice, symbolic version
- labeled_dice3.mod: Labeled dice, symbolic and general version
Data files:
- langford.mod: Langford's number problem (CSPLib problem 24)
- langford1.mod: Langford's number problem, simpler version (not CP)
- latin_square_card_puzzle.mod: Latin square card puzzle
- lectures.mod: Simple lecture scheduling problem (Biggs: "Discrete Mathematics")
- lecture_series.mod: Lecture Series (Dell Logic Puzzles)
- magic_hexagon.mod: Magic hexagon (CSPLib)
- magic_hexagon2.mod: Magic hexagon, symbolic version (CSPLib)
- magic_sequence.mod: Magic sequence (CSPLib)
- magic_square.mod: Magic squares
- magic_square_and_cards.mod: Magic square and cards (Martin Gardner)
- mamas_age.mod: Mama's age (Dudeney)
- map.mod: Simple map coloring exampleq
- map2.mod: Simple map coloring example (alternative encoding and some more countries tha map.mod)
- marathon2.mod: Marathon puzzle (XPress example)
- minesweeper.mod: Minesweeper puzzle
Data files:
- monks_and_doors.mod: Monks and doors problem
- mr_smith.mod: Mr Smith problem (IF Prolog)
- nqueens_cp.mod: N-queens problem
- number_of_days.mod: Number of days problem (knapsack) (Nathan Brixius)
- number_square.mod: Number square problem (Pascal Van Hentenryck, OPL book)
- olympic.mod: Olympic puzzle
- organize_day2.mod: Scheduling, organizing a day (ECLiPSe)
- pair_divides_the_sum.mod: Pairs divides the sum (comp.lang.prolog)
- partition_into_subsets_of_equal_values.mod: Partition into subset of equal sums
Data files:
- perfect_square_sequence.mod: Perfect square sequence
- pert.mod: Simple PERT problem (Pascal Van Hentenryck)
- photo_problem.mod: Photo problem (Oz)
Data files:
- picking_teams.mod: Picking teams (David Curran)
- place_number.mod: Placing Number Puzzle
- quasigroup_completion.mod: Quasigroup completion problem
Data files:
- rot13.mod: Rot 13 (Caesar ciper) (not CP)
- safe_cracking.mod: Safe cracking puzzle (Mozart/Oz primer)
- schedule1.mod: Scheduling problem, using (a decomposition of)
cumulative
constraint
- schedule2.mod: Scheduling problem (Dennis E. Sasha)
- scheduling_speakers.mod: Scheduling speakers (Rina Dechter)
- secret_santa.mod: Secret Santa problem
- secret_santa2.mod: Secret Santa problem II (optimize "Secret Santa distance")
- sicherman_dice.mod: Sicherman's dice
- social_golfers1.mod: Social golfers
- sonet_problem.mod: SONET problem
- strimko2.mod: Strimko grid puzzle
Data files:
- ski_assignment_problem.mod: Ski assignment problem
- stuckey_seesaw.mod: Seesaw placement problem (Marriott & Stuckey: Programming with Constraints)
- sudoku_cp.mod: Sudoku solver
Data files:
- survo_puzzle.mod: Survo puzzle
Data files:
- talisman_square.mod: Talisman square
- timpkin.mod: Mrs Timpkin's Age problem (Dudeney)
- torn_number.mod: Torn number problem (Dudeney)
- traffic_lights.mod: Traffic lights problem (CSPLib #16)
- tourist_site_competition.mod: Tourist Site Competition
- twin_letters.mod: Twin letters puzzle
- wedding_optimal_chart.mod: Finding an optimal wedding seating chart
- who_killed_agatha.mod: Who killed Agatha? (The Dreadsbury Mansion Murder Mystery)
- young_tableaux.mod: Young tableaux and partition
- zebra_cp.mod: Zebra problem ("Who owns the Zebra? Who drinks the water?")
My AMPL models (non CP)
Here are some of my AMPL models, many where written in autumn 2007 or spring 2008 when I studied (privatly) Operational Research and LP/MIP (after that I mostly used Constraint Programming systems such as
MiniZinc for solve these kind of problems).
Quite a few models are translations of Martin Chlond's models Integer Programming in Recreational Mathematics. Please note that many of these models do not use the newer Constraint Programming support in AMPL. See My AMPL+CP models above for this.
- 3_jugs.mod: 3 jugs problem (as shortest path problem)
- 50_puzzle.mod: Fifty puzzle (Martin Chlond)
- 5x5_puzzle.mod: Five puzzle (Martin Chlond)
- abbots_puzzle2.mod: The Abbott's Puzzle (Martin Chlond)
- abbots_puzzle.mod: The Abbott's Puzzle (Martin Chlond)
- abbott.mod: The Abbott's Window (Martin Chlond)
- assignment2.mod: Assignment problem (Winston's swimming team example)
- assignment3.mod: Assigment problem (Winston, celebreties on an island)
- assignment.mod: Assignment problem (Winston)
- ballistic.mod:
- bananas.mod: Bananas problem.
- birthdays_coins.mod: Tommy's Birthday Coins (Martin Chlond)
- book_buy.mod: Book buy puzzle (Martin Chlond)
- box.mod: Design a box at minimum cost (Lingo)
- branch_and_bound.mod: Branch and bound (Winston)
- branch_bound_taha.mod: Branch and bound (Taha)
- building_design.mod: Optimize building a building
- bus_scheduling.mod: Bus scheduling (Taha)
- capital_budget2.mod: Capital Budget (Winston)
- capital_budget.mod: Capital Budget (Winston)
- change_making.mod: Change Maker Problem (Martello: "Knapsack Problems")
- chessset.mod: Chess set problem (XPress)
- coin_change2.mod: Coin Change
- coin_change.mod: Coin Change
- coin_puzzle2.mod: Lewis Carroll coin puzzle (Martin Chlond)
- coins.mod: Coin puzzle (Martin Chlond)
- coins2.mod: Coins Problem (Martin Chlond)
- coins3.mod: Minimum mumber of coins that allows one to pay exactly any amount smaller than one Euro
- coins_grid.mod: Coins Grid problem (Tony Hurlimann)
- color_simple.mod: Simple coloring of a map (Murty)
- cookie_bake_off.mod: Cookie Bake Off problem (PuzzlOr)
- critical_path1.mod: Critical Path (Winston)
- crowd.mod: The crowded board (Martin Chlond)
- cutting_stock_winston.mod: Cutting stock problem (Winston)
- cyclohexane.mod: Cyclohexane problem (Dudeney)
- dakota_furniture.mod: Optimization problem (Winston)
- debruijn.mod: de Bruijn sequence (graph)
- defending_castle.mod: Defending the Castle (Cut the knot)
- diet_small.mod: Diet problem
- dinner.mod: A dinner problem
- dqueens.mod: Dudeney's queen placement problem (Martin Chlond)
- dress_party.mod: Dressing party (Mr Greenguest problem) (LPL)
- dudeney_bishop_placement1.mod: Dudeney's bishop placement problem I (Martin Chlond)
- dudeney_bishop_placement2.mod: Dudeney's bishop placement problem II (Martin Chlond)
- dynamical_optimization1.mod: Dynamical optimization
- dynamical_optimization2.mod: Dynamical optimization
- earthlin.mod: Earthlings (Martin Chlond)
- egg_basket.mod: Egg basket puzzle (Martin Chlond)
- einstein_hurlimann.mod: Einstein puzzle (variant of Zebra puzzle)
- elevator.mod: A Tokyo Elevator Puzzle
- enigma.mod: Enigma (Martin Chlond)
- evens.mod: Evens puzzle 2 (Martin Chlond)
- evision.mod: Equal Vision (Martin Chlond)
- fill_a_pix.mod: Fill-a-pix (not CP)
Data files:
- five.mod: 5 X 5 puzzle v 2 (Martin Chlond)
- games.mod: Simple game theory example (Vanderbei "Linear Programming - Foundations - and Extensions", page 147ff)
- game_theory_taha.mod: Game theory, zero sum game (Taha, Operations Research)
- giapetto.mod: Simple optimization problem of maximizing profit
- goal_programming1.mod: Goal programming (Winston)
- gomorys_cut.mod: Gomory's cut (small example)
- hitchcock_transporation_problem.mod: Hitchcock-Koopmans transportation problem
- honey_division.mod: Honey division puzzle (Martin Chlond)
- hurlimann_clarke_tobacco.mod: Clarke's Tobacco problem (Hurlimann)
- hurlimann_math01.mod: Tobacco problem (Hurlimann)
- hurlimann_math02.mod: Twelve problem (Hurlimann)
- hurlimann_math03.mod: Eggs problem (Hurlimann)
- ickelinj.mod: Nonlinear problem
- jive_turkeys.mod: Jive turkeys (Martin Chlond)
- joshua.mod: Joshua and his rats (Martin Chlond)
- knapsack.mod: Knapsack problem. Data instances: knapsack2.dat , knapsack3.dat , knapsack4.dat ,
- knapsack.dat
- knapsack5.mod: Knapsack problem
- knight_domination_puzzle.mod: Knight domination puzzle - all squares threatened (Martin Chlond)
- knight_domination_puzzle2.mod: Knight domination puzzle - all squares threatened (alternative model)
- kntdom.mod: Knight domination puzzle - all squares threatened (Martin Chlond)
- kqueens.mod: Kraitchik's queen placement problem (Martin Chlond)
- lccoin.mod: Lewis Carroll coin puzzle (Martin Chlond)
- least_diff2.mod: Least diff problem: What is the smallest difference between two numbers X - Y if you must use all the digits (0..9) exactly once?
- least_diff3.mod: Least diff problem, variant
- least_diff4.mod: Least diff problem, variant
- least_square_optimeringslara_286.mod: Least sqauare (Lundgren, Rönnqvist, Värbrand: Optimeringslära)
- least_square_winston.mod: Least square problem (Winston)
- lights.mod: Lights on puzzle (Martin Chlond)
- magic.mod: Magic square, integer programming (GLPK)
- magic_square2.mod: Magic squares
- magic_square_taha.mod: Magic squares
- mango_puzzle.mod: Mango puzzle (Martin Chlond)
- marathon.mod: Marathon puzzle (XPress example), MIP model
- max_flow_winston1.mod: Maximum flow problem (Winston)
- max_flow_winston2.mod: Maximum flow problem (Winston)
- maximum_flow.mod: Maximum flow problem
- minimum_cost_network_flow_problem1.mod:
- monte_carlo.mod: , monte_carlo.run:
- murty_781.mod: Coin Bags problem (subset sum) (Murty)
- murty_782.mod: Another subset sum problem (Murty)
- nim.mod: A Nimatron (Martin Chlond)
- nlp_winston_617.mod: Nonlinear problem (Winston)
- non_dominating_queens.mod: Non-dominating queens problem (Martin Chlond)
- nonlin1.mod: Nonlinear problem (Bazaras)
- nonlin2.mod: Nonlinear problem (Taha)
- nonlin3.mod: Nonlinear problem
- nonlin4_winston_656.mod: Nonlinear problem (Winston)
- nonlin5.mod: Nonlinear problem
- nonlin_optimeringslara_288.mod: Nonlinear problem
- nonlin_optimeringslara_555.mod: Nonlinear problem
- nonlin_sin.mod: Nonlinear problem
- onroad.mod: On the road (Martin Chlond)
- optimeringslara_126.mod: Sensitivity analysis
- optimeringslara_386.mod: Integer problem
- organize_day.mod: Scheduling, organizing a day
- pigeon_hole.mod: Pigeon hole problem
- pilgrim.mod: The Riddle of the Pilgrims (Martin Chlond)
- post_office_problem2.mod: Post office problem (Winston)
- post_office_problem.mod: Post office problem (Winston)
- public_school_problem.mod: Public School Problem (Martin Chlond)
- puzzle1.mod: Yet another column/row sum problem
- remainder_puzzle.mod: Remainder puzzle (Martin Chlond)
- remainder_puzzle2.mod: Remainder puzzle (Kordemsky)
- rosebush.mod: A Nimatron (Martin Chlond)
- sendmore_hurlimann.mod: SEND+MORE=MONEY
- send_more_money2.mod: SEND+MORE=MONEY
- send_more_money3.mod: SEND+MORE=MONEY
- send_more_money4.mod: SEND+MORE=MONEY
- sensitivity_analysis.1.mod: Sensitivity Analysis)
- seseman.mod: , Seseman Convent problem (run file: seseman.run: )
- set_comparison.mod: Set comparisons in AMPL
- set_covering3.mod: Set covering, senators making a committe (Murty)
- set_covering4.mod: Set covering problem (Lundgren, Rönnqvist, Värbrand "Optimeringslära"), requires set_cov1.dat)
- set_covering_deployment.mod: Set covering deployment
- set_covering_opl.mod: Set covering: workers building a house (OPL)
- set_covering_skiena.mod: Set covering (Steven Skiena)
- set_covering_winston1.mod: Set covering, placing firestations (Winston)
- set_packing.mod: Set packing
- shortest_path1.mod: Shortest path problem, selling/buying a car (Winston)
- shortest_path2.mod: Shortest path problem (Winston)
- smullyan_portia.mod: Raymond Smullyan's Portia problems
- spreadsheet.mod: "Spreadsheet problem"
- squeens.mod: Schuh's queen placement problem (Martin Chlond)
- stamp_licking.mod: The gentle art of stamp-licking (Martin Chlond)
- subset_sum.mod: Subset sum (Murty)
- sum_squares.mod: Sum of squares problem
- taha_21.mod: Optimization problem (Taha)
- tea_mixing.mod: Dudeney's tea mixing problem (Martin Chlond)
- tobacco.mod: Clarke's tobacconist (Martin Chlond)
- tomography.mod: Discrete Tomography (one color model)
- transportation.mod: Transportation problem
- transshipment.mod: Transshipment problem (Winston)
- trial1.mod: The First Trial (Martin Chlond)
- trial2.mod: The Second Trial (Martin Chlond)
- trial3.mod: The Third Trial (Martin Chlond)
- trial4.mod: The Fourth Trial (Martin Chlond)
- trial5.mod: The Fifth Trial (Martin Chlond)
- trial6.mod: The Sixth Trial (Martin Chlond)
- trial12_variant.mod: The Logical Labyrinth (Martin Chlond)
- tsp_winston.mod: Travelling Salesman Problem, integer programming
- twelve.mod: Twelve draughts puzzle (Martin Chlond)
- warehouse_location.mod: Warehouse location problem (Winston)
- were2.mod: Werewolves II (Martin Chlond)
- were4.mod: Werewolves IV (Martin Chlond)
- williams_131.mod: Nonlinear problem (Williams)
- wine_cask_puzzle.mod: Wine Cask puzzle (Martin Chlond)
- winston373.mod: Row/Column sum puzzle (sub problem of transportation problem)
- work2.mod: Simple word problem (regarding workers)
- work3.mod: Simple word problem (regarding workers)
- work_hour.mod: Simple word problem (regarding workers)
- xkcd.mod: xkcd's knapsack problem (see the xkcd strip for the problem)
Also, see my other pages about Constraint Programming systems:
* My Constraint Programming Blog
* Constraint Programming
* Common constraint programming problems
* My MiniZinc page
* My Zinc page
* My JaCoP page
* My JaCoP/Scala page
* My Choco page
* My Gecode/R page
* My Comet page
* My Gecode page
* My ECLiPSe page
* My Tailor/Essence' page
* My SICStus Prolog page
* My Google CP Solver page
* My OscaR page
* My JSR-331 page
* My Numberjack page
* My AIMMS+CP page
* My B-Prolog page
* My Choco3 page
* My Picat page
* My z3/python page
* My SWI-Prolog page
Back to my homepage
Created by Hakan Kjellerstrand hakank@gmail.com