My MiniZinc page
This page was created by Hakan Kjellerstrand (hakank@bonetmail.com).
MiniZinc constraint programming system
MiniZinc is a very interesting constraint programming system/modeling language with a high level syntax. Some important links:
Solvers
In order to solve a problem stated in the MiniZinc modeling language a solver must be used. The following solvers were available as of 2008-06-22.
- flatzinc: the solver distributed with the MiniZinc system.
- Gecode/FlatZinc. Requires that Gecode is installed.
- The ECLiPSe Constraint Programming System library(minizinc) (and library(flatzinc) provides 3 different solvers which corresponds to ECLiPSe's "normal" solvers:
* fzn_ic, see library(ic)
* fzn_fd, see library(fd)
* fzn_eplex, see library(eplex), which in turn can use different solvers, e.g. the commercial Cplex, XPress-MP, or the open source COIN solvers symclp, clpcbc.
Note: As of 2008-06-22 the ZincInterface is not in the official ECLiPSe release, just in development releases of the 5.10 branch, and somewhat later also the 6 branch. Fetch it e.g. from here.
- fzntini. A SAT solver based on Tinisat.
Blog posts
I have blogged about MiniZinc etc. Some post posts are in swedish (also a link to google translation):
- Constraint Programming: Minizinc, Gecode/flatzinc och ECLiPSe/minizinc (google translation from swedish to english: Constraint Programming: Minizinc, Gecode / flatzinc and ECLiPSe / minizinc)
- MiniZinc-sida samt fler MiniZinc-exempel (google translation: MiniZinc-side and more MiniZinc-examples)
- Applikationer med constraint programming, lite om operations research samt nya MiniZinc-modeller (google translation: Applications with constraint programming, a little about operations research and new models MiniZinc)
- Några fler MiniZinc-modeller, t.ex. Smullyans Knights and Knaves-problem (google translation: A few more MiniZinc models, such as Smullyans Knights and Knaves-problem Smullyans Knights and knaves problems)
- MiniZinc/FlatZinc version 0.8 släppt (google translation: MiniZinc / FlatZinc version 0.8 released)
- Nya MiniZinc-modeller, flera global constraints, däribland clique (google translation: New MiniZinc models, several global constraints, including the clique)
- Mats Anderssons tävling kring fotbolls-EM 2008 - ett MiniZinc-genererat tips (google translation: Mats Andersson's competition around the European football championships in 2008 - a MiniZinc-generated tips)
- Tre matematiska / logiska pyssel med constraint programming-lösningar: n-puzzle, SETS, M12 (i MiniZinc)
- MiniZinc-nyheter
- Martin Chlond's Integer Programming Puzzles i MiniZinc
- Fler MiniZinc modeller kring recreational mathematics
- Fler constraint programming-modeller i MiniZinc, t.ex. Minesweeper och Game of Life
My MiniZinc models
The following is a list of (some of) my models: simple puzzles and not so simple puzzles, standard operation research / integer programming examples, and some global constraints (that are not in the MiniZinc globals.mzn). Some are just examples of modelling in MiniZinc.
Almost all models are commented with sources or inspirations, and quite a few have the main problem generalized as a predicate.
Some of the models has been commented in my (swedish) blog posts Constraint Programming: Minizinc, Gecode/flatzinc och ECLiPSe/minizinc, MiniZinc-sida samt fler MiniZinc-exempel, Några fler MiniZinc-modeller, t.ex. Smullyans Knights and Knaves-problem.
Puzzles, small and large
- 3_jugs.mzn: 3 jugs problem (as shortest path problem)
- 3_jugs2.mzn: 3 jugs problem (using shortest_path_model.mzn)
- a_round_of_golf.mzn: A round of golf puzzle (Dell Logic Puzzles)
- added_corner.mzn: Added corner puzzle
- arch_friends.mzn: Arch friends puzzle (Dell Logic Puzzles)
- averbach_1.2.mzn: Example 1.2 i Averbach & Chein "Problem Solving Through Recreational Mathematics"
- averbach_1.2.mzn: Example 1.3 i Averbach & Chein "Problem Solving Through Recreational Mathematics"
- averbach_1.2.mzn: Example 1.4 i Averbach & Chein "Problem Solving Through Recreational Mathematics"
- averbach_1.2.mzn: Example 1.5 i Averbach & Chein "Problem Solving Through Recreational Mathematics"
- babysitting.mzn: Babysitting puzzle (Dell Logic Puzzles)
- breaking_news.mzn: Breaking news puzzle (Dell Logic Puzzles)
- clock_triplets.mzn: Clock Triplets
- coins_grid.mzn: Coins Grid (Tony Hurlimann)
- coins3.mzn: Minimum mumber of coins that allows one to pay exactly any amount smaller than one Euro
- col_sum_puzzle.mzn: Find out values in a matrix, given column and row sums and some hints.
- crossword.mzn: Crossword solving (standard constraint programming example)
- crypta.mzn: crypta, alphametic problem (standard Prolog benchmark)
- cur_num.mzn: Curious Number (Dudeney)
- defending_castle.mzn: Defending the Castle (Cut the knot)
- devils_word.mzn: Devil's Word problem (see the Devil's word page)
- digits_of_the_square.mzn: Digits of the square problem
- dinner.mzn: A dinner problem
- dividing_the_spoils.mzn: Dividing the spoils (Sam Loyd)
- donald.mzn: Alphametic puzzle: DONALD + GERALD = ROBERT
- drinking_game.mzn: Drinking game (Marriott & Stuckey)
- einstein_hurlimann.mzn: Einstein puzzle (variant of Zebra puzzle)
- enigma_1000.mzn: Enigma ENIGMA / M = TIMES puzzle (#1000)
- enigma_1001.mzn: Enigma What the hex? puzzle (#1001)
- enigma_1293.mzn: Enigma Reverse Fahrenheitpuzzle (#1293)
- enigma_birthday_magic.mzn: Enigma birthday puzzle (#1448)
- enigma_circular_chain.mzn: Enigma circular chain puzzle (#985)
- enigma_eight_times.mzn: Enigma Eight times puzzle (#1317)
- enigma_eight_times2.mzn: Enigma Eight times puzzle (#1317), alternative model
- enigma_eighteen.mzn: Enigma Eighteen puzzle (#1496)
- enigma_five_fives.mzn: Enigma Five fives puzzle (#1358)
- enigma_planets.mzn: Enigma planets puzzle (#1396)
- enigma_portuguese_squares.mzn: Enigma portuguese squares puzzle (#1476)
- ett_ett_ett_ett_ett__fem.mzn: Alphametic puzzle ETT + ETT + ETT + ETT + ETT = FEM
- fancy.mzn: Mr Greenguest puzzle (Fancy dress puzzle)
- farm_puzzle0.mzn: Farm puzzle, simple model
- farm_puzzle.mzn: Farm puzzle, more general model
- five_brigades.mzn: Five brigades (Dudeney)
- four_islands.mzn: Four islands puzzle (Dell Logic Puzzles)
- fractions.mzn: Fractions, alphametic problem (standard Prolog benchmark)
- franklin_8x8_magic_square.mzn: Benjamin Franklin's 8x8 Magic Square
- futoshiki.mzn: Futoshiki puzzle
- gardner_dinner.mzn: Dinner problem (Martin Gardner)
- gardner_prime_puzzle.mzn: Martin Gardner's prime puzzle
- grocery2.mzn: Grocery problem, alternative version
- huey_dewey_louie.mzn: Huey, Dewey, Louie, logical problem from Marriott & Stuckey "Programming in Constraints"
- heterosquare.mzn: Heterosquare problem
- hundred_doors_unoptimized.mzn: 100 doors problem, unoptimized (array version)
- hundred_doors_unoptimized2.mzn: 100 doors problem, unoptimized (array version, alternative model)
- hundred_doors_optimized.mzn: 100 doors problem, optimized (set version)
- hundred_doors_optimized_array.mzn: 100 doors problem, optimized (array version)
- hundred_fowls.mzn: Hundred Fowls puzzle
- jobs_puzzle.mzn: Jobs puzzle (an automated reasoning problem)
- least_diff.mzn: Least diff problem: What is the smallest difference between two numbers X - Y if you must use all the digits (0..9) exactly once?
- lecture_series.mzn: Lecture series puzzle (Dell Logic Puzzles)
- locker.mzn: Locker puzzle.
- M12.mzn: Solving the M12 puzzle
- magic3.mzn: Magic sequence, 3 x 3 (this formulations is from a standard Prolog benchark)
- magic4.mzn: Magic sequence, 4 x 4 (this formulations is from a standard Prolog benchark)
- magic_sequence.mzn: Magic sequence (CSPLib)
- magic_sequence2.mzn: Magic sequence (CSPLib), alternative model
- magic_sequence3.mzn: Magic sequence (CSPLib), alternative model
- magic_sequence4.mzn: Magic sequence (CSPLib), alternative model
- marathon.mzn: Marathon puzzle (XPress example)
- minesweeper.mzn: Minesweeper puzzle
- money_change.mzn: Simple money change problem
- multipl.mzn: Unknown multiplication (standard Prolog benchmark)
- murder.mzn: Murder puzzle
- music_men.mzn: Music men puzzle
- n_puzzle.mzn: N-puzzle, e.g. 8-puzzle, 15-puzzle
- narcissistic_numbers.mzn: Narcissistic numbers
- nonogram.mzn: Nonogram, a.k.a. Painting by numbers
- number_generation.mzn: Number generation (cf Devil's word)
- olympic.mzn: Olympic problem (standard Prolog benchmark)
- peacableArmyOfQueens.mzn: Peacable Army of Queens
- photo_hkj.mzn: Photo problem
- photo_hkj2_model.mzn: Photo problem model
- photo_hkj2_data1.mzn: Data for photo problem
- photo_hkj2_data2.mzn: Data for photo problem
- place_number.mzn: The Eight Number Puzzle
- puzzle1.mzn: Yet another column/row sum problemi
- raven_puzzle.mzn: "Polyglot puzzle" (from Raven, swedish)
- remarkable_sequence.mzn: Remarkable sequence (from an Alma-0 model)
- safe_cracking.mzn: Safe cracking
- self_referential_quiz.mzn: Self-referential quiz
- send_more_money.mzn: Alphametic puzzle: SEND + MORE = MONEY
- send_more_money2.mzn: Alphametic puzzle: SEND + MORE = MONEY, alternative model
- send_most_money.mzn: Alphametic puzzle: SEND + MOST = MONEY (maximize MONEY)
- sequence_2_3.mzn: Simple permutation puzzle
- seseman.mzn: Seseman Convent problem (see Seseman Convent problem)
- seseman2.mzn: Seseman Convent problem, generalized model
- spy_girls.mzn: Spy girls problem
- set_puzzle.mzn: Solving SET Puzzles
- smullyan_knights_knaves.mzn: Raymond Smullyan's Knights and Knaves problems
- smullyan_knights_knaves_normals.mzn: Raymond Smullyan's Knights, Knaves, and Normals problems
- smullyan_knights_knaves_normals_bahava.mzn: Raymond Smullyan's Knights, Knaves, and Normals at the Island of Bahava problems
- smullyan_lion_and_unicorn.mzn: Raymond Smullyan's Lion and Unicorn problems
- smullyan_portia.mzn: Raymond Smullyan's Portia problems
- solitaire_battleship.mzn: Solitaire Battleship
- sudoku_25x25_250.mzn: Sudoku 25 x 25 problen (very hardcoded, from a Prolog benchmark)
- sum_to_100.mzn: Five numbers should sum to 100, and all numbers must be divisible by 2 or 5
- survo_puzzle.mzn: Survo puzzle
- talisman_square.mzn: Talisman Square
- tomography.mzn: Discrete Tomography (one color model)
- tomography_n_colors.mzn: Discrete Tomography (n color model)
- three_digit.mzn: Three digit problem
- torn_number.mzn: Torn number puzzle (Dudeney)
- tunapalooza.mzn: Tunapalooza puzzle (Dell Logic Puzzles)
- water_buckets1.mzn: Water bucket problem (generalized)
- who_killed_agatha.mzn: Who killed agatha? (The Dreadsbury Mansion Murder Mystery, a automated reasoning problem)
- word_golf.mzn: Word golf (word chain)
- word_golf_n3.mzn: 3 letter words for Word golf
- xkcd.mzn: xkcd's knapsack problem (see the xkcd strip )
Martin Chlond's Integer Programming Puzzles
Below are MiniZinc models of (almost) all puzzles of Martin Chlond's wonderful collections of Integer Programming Puzzles.
The collection is separated in four sections where the problems is presented
* Integer Programming Puzzles section 1
* Integer Programming Puzzles section 2
* Integer Programming Puzzles section 3
* Integer Programming Puzzles section 4
The models below are presented first with a link to MiniZinc page, and then to Martin Chlond's solution (in XPress Mosel, or for later solutions AMPL).
Problems from Integer Programming Puzzles section 1
Models:
Twelve draughts puzzle
(Chlond's solution)
Description : Twelve draughts puzzle
Source : Boris Kordemsky - The Moscow Puzzles (P36)
Coin puzzle
(Chlond's solution)
Description : Coin puzzle
Source : Mathematical Puzzles of Sam Loyd (P111)
Egg basket puzzle
(Chlond's solution)
Description : Egg basket puzzle
Source : Boris Kordemsky - The Moscow Puzzles (P136)
Evens puzzle
(Chlond's solution)
Description : Evens puzzle
Source : Boris Kordemsky - The Moscow Puzzles (P8)
Fifty puzzle
(Chlond's solution)
Description : Fifty puzzle
Source : The Puzzles of Sam Loyd (P 54)
Honey division puzzle
(Chlond's solution)
Description : Honey division puzzle
Source : H E Dudeney - Amusements in Mathematics
Wine cask puzzle
(Chlond's solution)
Description : Wine cask puzzle
Source : M Kraitchik - Mathematical Recreations (p 31)
Knight domination puzzle - all squares threatened
(Chlond's solution)
Description : Knight domination puzzle - all squares threatened
Source : M Kraitchik - Mathematical Recreations (P256)
Mango puzzle
(Chlond's solution)
Description : Mango puzzle
Source : M Kraitchik - Mathematical Recreations (P32)
Remainder puzzle
(Chlond's solution)
Description : Remainder puzzle
Source : Boris Kordemsky - The Moscow Puzzles (P136)
5 X 5 puzzle
(Chlond's solution)
Description : 5 X 5 puzzle
Source : Unknown
Lights on puzzle
(Chlond's solution)
Description : Lights on puzzle
Source : Unknown
Problems from Integer Programming Puzzles section 2
Models:
Clarke's tobacconist
(Chlond's solution)
Description : Clarke's tobacconist
Source : Clarke, L.H., (1954), Fun with Figures, William Heinemann Ltd.
Tommy's Birthday Coins
(Chlond's solution)
Description : Tommy's Birthday Coins
Source : Clarke, L.H., (1954), Fun with Figures, William Heinemann Ltd.
Lewis Carroll coin puzzle
(Chlond's solution)
Description : Lewis Carroll coin puzzle
Source : Wakeling, E., (1995), Rediscovered Lewis Carroll Puzzles, Dover.
Dudeney's tea mixing problem
(Chlond's solution)
Description : Dudeney's tea mixing problem
Source : Dudeney, H.E., (1917), Amusements in Mathematics, Thomas Nelson and Sons.
Jive turkeys
(Chlond's solution)
Description : Jive turkeys
Source : rec.puzzles
Public School Problem
(Chlond's solution)
Description : Public School Problem
Source : Clarke, L.H., (1954), Fun with Figures, William Heinemann Ltd.
Dudeney's bishop placement problem I
(Chlond's solution)
Description : Dudeney's bishop placement problem I
Source : Dudeney, H.E., (1917), Amusements in Mathematics, Thomas Nelson and Sons.
Dudeney's bishop placement problem II
(Chlond's solution)
Description : Dudeney's bishop placement problem II
Source : Dudeney, H.E., (1917), Amusements in Mathematics, Thomas Nelson and Sons.
Kraitchik's queen placement problem
(Chlond's solution)
Description : Kraitchik's queen placement problem
Source : Kraitchik, M., (1942), Mathematical Recreations, W.W. Norton and Company, Inc.
Schuh's queen placement problem
(Chlond's solution)
Description : Schuh's queen placement problem
Source : Schuh, F., (1943), Wonderlijke Problemen;
Leerzam Tijdverdrijf Door Puzzle en Speel, W.J. Thieme & Cie, Zutphen.
Dudeney's queen placement problem/a>
(Chlond's solution)
Description : Dudeney's queen placement problem
Source : Dudeney, H.E., (1917), Amusements in Mathematics, Thomas Nelson and Sons.
Joshua and his rats
(Chlond's solution)
Description : Joshua and his rats
Source : Sole, T., (1988), The Ticket to Heaven, Penguin Books
Problems from Integer Programming Puzzles section 3
Models:
The Abbott's Puzzle
(Chlond's solution)
Description : The Abbott's Puzzle
Source : Dudeney, H.E., (1917), Amusements in Mathematics, Thomas Nelson and Sons.
The Abbott's Window
(Chlond's solution)
Description : The Abbott's Window
Source : Dudeney, H.E., (1917), Amusements in Mathematics, Thomas Nelson and Sons.
The First Trial
(Chlond's solution)
Description : The First Trial
Source : Smullyan, R., (1991), The Lady or The Tiger, Oxford University Press
The Second Trial
(Chlond's solution)
Description : The Second Trial
Source : Smullyan, R., (1991), The Lady or The Tiger, Oxford University Press
The Third Trial
(Chlond's solution)
Description : The Third Trial
Source : Smullyan, R., (1991), The Lady or The Tiger, Oxford University Press
The Fourth Trial
(Chlond's solution)
Description : The Fourth Trial
Source : Smullyan, R., (1991), The Lady or The Tiger, Oxford University Press
The Fifth Trial
(Chlond's solution)
Description : The Fifth Trial
Source : Smullyan, R., (1991), The Lady or The Tiger, Oxford University Press
The Sixth Trial
(Chlond's solution)
Description : The Sixth Trial
Source : Smullyan, R., (1991), The Lady or The Tiger, Oxford University Press
Werewolves II
(Chlond's solution)
Description : Werewolves II
Source : Smullyan, R., (1978), What is the Name of this Book?, Prentice-Hall
Werewolves IV
(Chlond's solution)
Description : Werewolves IV
Source : Smullyan, R., (1978), What is the Name of this Book?, Prentice-Hall
Earthlings
(Chlond's solution)
Description : Earthlings
Source : Poniachik, J. & L., (1998), Hard-to-solve Brainteasers, Sterling
Equal Vision
(Chlond's solution)
Description : Equal Vision
Source : Poniachik, J. & L., (1998), Hard-to-solve Brainteasers, Sterling
Problems from Integer Programming Puzzles section 4
Models:
On the road
(Chlond's solution)
Description : On the road
Source : Poniachik, J. & L, (1998), Hard-to-solve Brainteasers, Sterling
The Riddle of the Pilgrims
(Chlond's solution)
Description : The Riddle of the Pilgrims
Source : Dudeney, H.E., (1949), The Canterbury Puzzles, 7th ed., Thomas Nelson and Sons.
The Logical Labyrinth
(Chlond's solution)
Description : The Logical Labyrinth
Source : Smullyan, R., (1991), The Lady or The Tiger, Oxford University Press
The gentle art of stamp-licking
(Chlond's solution)
Description : The gentle art of stamp-licking
Source : Dudeney, H.E., (1917), Amusements in Mathematics, Thomas Nelson and Sons.
The crowded board
(Chlond's solution)
Description : The crowded board
Source : Dudeney, H.E., (1917), Amusements in Mathematics, Thomas Nelson and Sons.
Non-dominating queens problem
(Chlond's solution)
Description : Non-dominating queens problem
Source : http://www.cli.di.unipi.it/~velucchi/queens.txt
Enigma
(Chlond's solution)
Description : Enigma
Source : Herald Tribune circa November 1979 - courtesy of Dr Tito A. Ciriani
Price change puzzle
(Chlond's solution)
Source: M Kraitchik, Mathematical Recreations (p 33-35), Dover
Book buy puzzle
(Chlond's solution)
Source: M Kraitchik, Mathematical Recreations(p37), Dover
Shopping puzzle
(Chlond's solution)
Source: M Kraitchik, Mathematical Recreations(p37), Dover
Book discount problem
(Chlond's solution)
Source: J. & L. Poniachik, Hard-to-Solve Brainteasers (p16), Sterling
Seven 11 (Chlond's solution)
Source: alt.math.recreational
Models based on Martin Chlond's Puzzle articles in Informs Transations on Education
And here is some other models of recreational mathematics created by Martin Chlond, published in the Puzzle section of Informs Transations on Education (an open OR journal).
Operations research, linear programming, integer programming
- assignment.mzn: Assignment problem (Winston)
- assignment2.mzn: Assignment problem (Winston's swimming team example)
- assignment2_2.mzn: Assignment problem (Winston's swimming team example, expanded)
- assignment3.mzn: Assigment problem (Winston, celebreties on an island)
- assignment_model.mzn: Assigment problem (model)
- bus_scheduling.mzn: Bus scheduling (Taha)
- capital_budget2.mzn: Capital Budget (Winston)
- chessset.mzn: Chess set problem (XPress)
- contractor_costs.mzn: Contractor costs (Sam Loyd)
- crew.mzn: Crew scheduling (Gecode)
- crossbar.mzn: Crossbar problem (Prolog benchmark problem)
- critical_path1.mzn: Critical Path (Winston)
- cutting_stock_winston.mzn: Cutting stock problem (Winston)
- dea.mzn: Data Envelopment Analysis (DEA) model
- diet1.mzn: Diet problem (standard OR example)
- football.mzn: Buying soccer players (lp_solve mailing list)
- freight_transfer.mzn: Freight Transfer (John Hooker)
- furniture_moving.mzn: Optimizing furniture moving (Marriott and Stuckey)
- giapetto.mzn: Simple optimization problem of maximizing profit
- hitchcock_transporation_problem.mzn: Hitchcock-Koopmans transportation problem
- integer_programming1.mzn: Simple integer programming problem
- knapsack_investments.mzn: Knapsack (investment) problem (Lundgren, Rönnqvist, Värbrand: Optimerings lära)
- lager.mzn: Stock model (swedish)
- least_square_optimeringslara_286.mzn: Least sqauare (Lundgren, Rönnqvist, Värbrand: Optimeringslära)
- markov_chains.mzn: Markov chain of market shares (from "Statistisk Dataanalys")
- markov_chains_taha.mzn: Markov chains (fertlizer example from Taha "Operations Research")
- max_flow_taha.mzn: Maximum flow problem (Taha)
- nadel.mzn: B.A. Nadel's construction problem
- organize_day.mzn: Scheduling, organizing a day (ECLiPSe)
- pert.mzn: PERT problem (van Hentenryck)
- post_office_problem.mzn: Post office problem (Winston)
- post_office_problem2.mzn: Post office problem, generalized model (Winston)
- prod0.mzn: Optimization problem (AMPL)
- product_configuration.mzn: Product configuration (John Hooker)
- rostering.mzn: Rostering problem (Regin)
- schedule1.mzn: Scheduling using cumulative constraint (Sicstus)
- scheduling_chip.mzn: Scheduling problem from Nicolas Beldiceanu & Evelyne Contejean "Introducing Global Constraints in CHIP", page 3
- scheduling_speakers.mzn: Scheduling speakers (Rina Dechter)
- social_golfers1.mzn: Social golfers (OPL)
- stable_marriage.mzn: Stable marriage
- stuckey_assignment.mzn: Assignment problem (Marriott and Stuckey)
- stuckey_seesaw.mzn: Balancing on a seesaw (Marriot and Stuckey)
- talent.mzn: Talent example from ILOG OPL
- transportation.mzn: Transportation problem (ECLiPSe)
- transportation2.mzn: Transportation problem, generalized model
- transshipment.mzn: Transshipment problem (Winston)
Non linear problems
Combinatorial problems
- balanced_matrix.mzn: Balanced matrix
- bin_packing.mzn: Bin packing
- color_simple.mzn: Simple coloring of a map (Murty)
- decision_tree_binary.mzn: Binary decision tree
- debruijn_binary.mzn: de Bruijn sequence (graph)
- dominating_set.mzn: Dominating set problem
- fix_points.mzn: Number of fix points in an array
- graph_degree_sequence.mzn: Degree sequence for graphs, both matrix and edge representation
- gray_code.mzn: Gray code
- hamming_distance.mzn: Hamming distance
- K4P2GracefulGraph.mzn: K4P2 Graceful Graph
- K4P2GracefulGraph2.mzn: K4P2 Graceful Graph (more general model)
- knapsack.mzn: Knapsack
- knapsack2.mzn: Another knapsack
- langford2.mzn: Langford sequence
- latin_square.mzn: Latin squares
- lectures.mzn: Lectures, schedule problem from Biggs "Discrete Mathematics"
- map.mzn: Simple coloring of a map
- map_stuckey.mzn: Another coloring of a map (Marriott and Stuckey)
- modulo_partition.mzn: Function partitioning
- parallel_resistors.mzn: Parallel resistors problem problem from Marriott & Stuckey "Programming in Constraints"
- partial_latin_square.mzn: Partial Latin squares
- partitions.mzn: Integer partitions
- perfect_shuffle.mzn: Perfect shuffle
- pigeon_hole.mzn: Pigeon hole problem (CLP-FD)
- pigeon_hole2.mzn: Another pigeon hole problem
- power_set.mzn: Power set
- quasiGroup3Idempotent.mzn: Quasigroup existence problem 3(CSPLib)
- quasiGroup3NonIdempotent.mzn: Quasigroup existence problem 3 (CSPLib)
- quasiGroup4Idempotent.mzn: Quasigroup existence problem 4(CSPLib)
- quasiGroup4NonIdempotent.mzn: Quasigroup existence problem 4(CSPLib)
- quasiGroup5Idempotent.mzn: Quasigroup existence problem 5(CSPLib)
- quasiGroup5NonIdempotent.mzn: Quasigroup existence problem 5(CSPLib)
- quasiGroup6.mzn: Quasigroup existence problem 6 (CSPLib)
- quasiGroup7.mzn: Quasigroup existence problem 7 (CSPLib)
- quasigroup_completion.mzn: Quasigroup completion problem
- quasigroup_completion_model.mzn: Quasigroup completion problem, model used by the following instances:
- runs.mzn: Number of runs in an array (sequence)
- set_covering.mzn: Set covering, placing of firestations (Winston)
- set_covering2.mzn: Set covering, number of security telephons on a campus (Taha)
- set_covering3_model.mzn: Set covering model
- set_covering3.mzn: Set covering, senators making a committe (Murty)
- set_covering4.mzn: Set covering problem (Lundgren, Rönnqvist, Värbrand "Optimeringslära")
- set_covering4b.mzn: Set covering problem, generalized version of set_covering4.mzn
- set_covering5.mzn: Set covering, work scheduling (Lundgren, Rönnqvist, Värbrand "Optimeringslära")
- set_covering_deployment.mzn: Set covering deployment
- set_covering_skiena.mzn: Set covering (Skiena)
- set_packing.mzn: Set packing
- set_partition.mzn: Set partitioning
- shortest_path1.mzn: Shortest path problem, selling/buying a car (Winston)
- shortest_path2.mzn: Shortest path problem (Winston)
- shortest_path_model.mzn: Model for shortest path
- sonet_problem.mzn: SONET problem
- subset_sum.mzn: Subset sum (Murty)
- transpose.mzn: (Square) matrix operations, transpose, scalar addition, scalar multiplication
- tsp_circuit.mzn: Travelling salesperson problem, using circuit predicate
- voltage_divider.mzn: Voltage divider problem problem from Marriott & Stuckey "Programming in Constraints"
- young_tableaux.mzn Young tableaux
Global constraints
Here are implementations of some of the global constraints (which are not already implemented in the MiniZinc globals.mzn) described in the great collection Global Constraint Catalog. Some global constraints not in the catalogue are also modelled.
- all_differ_from_at_least_k_pos.mzn: all_differ_from_at_least_k_pos, all rows in a matrix has values that differs in at least k positions
- all_min_dist.mzn: all_min_dist, all values must have a minimum distance to each other
- alldifferent_cst.mzn: alldifferent_cst, and alldifferent_cst using multiplication instead of addition
- alldifferent_except_0.mzn: alldifferent except 0
- alldifferent_interval.mzn: alldifferent_modulo, all values modulo k shall be different
- alldifferent_modulo.mzn: alldifferent_modulo, all values modulo k shall be different
- alldifferent_on_intersection.mzn: alldifferent_on_intersection
- alldifferent_partition.mzn: alldifferent_partition
- alldifferent_same_value.mzn: alldifferent_same_value
- alldifferent_soft.mzn: alldifferent_soft (alldifferent_soft_ctr and alldifferent_soft_var)
- allperm.mzn: allperm, ensures that the first rows in a matrix is lexically less than all permutation of all other rows
- all_min_dist.mzn: all_min_dist, all pairs in an array have a distance of at least c
- among_diff_0.mzn: among_diff_0, number of values different from 0
- among_interval.mzn: among_interval, number of values in a certain interval
- among_low_up.mzn: among_low_up, the number values in an array matched another array shoule be constrained to low and up
- among_modulo.mzn: among_modulo, the number values in an array where a value modulo quotient = remainder
- among_seq.mzn: among_seq
- and.mzn: and, generalized and (array)
- arith.mzn: arith, enforces that all values in an array is RELOP (equal, not equal, less than, etc) some VALUE
- arith_or.mzn: arith_or
- arith_sliding.mzn: arith_sliding, all sliding sums from 1..j must satisfy RELOP VALUE
- assign_and_counts.mzn: assign_and_counts
- atleast_nvalue.mzn: atleast_nvalue, at least NVAL values are different in an array
- atmost1.mzn: atmost1
- atmost_nvalue.mzn: atmost_nvalue, at most NVAL values are different in an array
- balance.mzn: balance, difference between the least and largest number of occurrences in an array
- between_min_max.mzn: between_min_max, a specific number is between the minimum and maximum value of an array
- bin_packing2.mzn: Bin packing (different from the one above)
- cardinality_atleast: cardinality_atleast
- cardinality_atmost: cardinality_atmost
- cardinality_atmost_partition: cardinality_atmost_partition
- change.mzn: circular change, number of changes in an array
- change_pair.mzn: change_pair
- change_partition.mzn: change_partition
- circular_change.mzn: circular change, number of changes in an array (as change but with wrapping around the corner)
- circuit.mzn: circuit
- clique.mzn: clique
- common.mzn: common, also used_by
- cond_lex_cost.mzn: cond_lex_cost
- cond_lex_less.mzn: cond_lex_less, cond_lex_lesseq, cond_lex_greater, cond_lex_greatereq
- count_ctr.mzn: count, more general than count in MiniZinc's globals.mzn
- counts.mzn: counts
- correspondence.mzn: correspondence
- cumulative_test.mzn: Test of cumulative (defined in globals.mzn)
- cycle.mzn: cycle
- decreasing.mzn: decreasing
- derangement.mzn: derangement
- diffn.mzn: diffn, (with three different representations of the orthotopes)
- discrepancy.mzn: discrepancy
- discjuntive.mzn: disjunctive
- distance_between.mzn: distance between
- global_contiguity.mzn: global contiguity
- inflexions.mzn: inflexions, number of peaks in a sequence
- in_relation.mzn: in_relation
- in_same_partition.mzn: in_same_partition
- int_value_precede.mzn: int_value_precede
- k_alldifferent.mzn: k alldifferent (all rows satisfy the alldifferent constraint)
- k_same.mzn: k_same
- longest_change.mzn: longest change, size of the longest sub sequence which satisfy a comparison operator (such as !=, <, > etc)
- nchange.mzn: nchange, (also a generalized version nchange_cmp with choice of operators)
- n_partitioning.mzn: n_partitioning
- n_change.mzn: n_change
- nvalue.mzn: nvalue, also: atleast_nvalue and atmost_nvalue
- nvalues.mzn: nvalues
- open_alldifferent.mzn: open_alldifferent
- path_from_to.mzn: path_from_to, find a path from FROM to TO in a graph (incidence matrix)
- period.mzn: period (a sequence must have a period of a specific length)
- precedence.mzn: precedence (the first time we use j is before the first time we use k, for j < k)
- roots_test.mzn: Test of roots (defined in globals.mzn)
- same.mzn: same
- stretch_circuit.mzn: stretch_circuit
- stretch_path.mzn: stretch_path
- strictly_decreasing.mzn: strictly_decreasing. Also strictly_increasing and decreasing
- subsequence.mzn: subsequence
- subsequence_sum.mzn: subsequence sum
- sum_ctr.mzn: sum ctr
- sum_free.mzn: sum free, also: product_free
- sum_set.mzn: sum set
- symmetric.mzn: symmetric
- symmetric_alldifferent.mzn: symmetric_alldifferent
Other models
Math, etc.
Also, see My JaCoP page (JaCoP is a constraint programming system in Java)
Back to my homepage
Created by Hakan Kjellerstrand hakank@bonetmail.com