Thursday, December 24, 2015

Goat, wolf, cabbage

In this post the question was raised if we could solve the famous puzzle:

image_thumb[1]

(see: http://www.mathcats.com/explore/river/crossing.html). Here is my attempt:

image_thumb[3]

The ‘Eat’ table looks like:

image

This is based on: http://yetanothermathprogrammingconsultant.blogspot.com/2011/10/integer-cuts.html.

The equations look like:

image_thumb[5]

The results look like:

----     64 VARIABLE pax.L  items taken on each trip

                 wolf        goat     cabbage

trip1.L2R                       1
trip2.L2R           1
trip2.R2L                       1
trip3.L2R                                   1
trip4.L2R                       1

Note that empty trips are not displayed in this report. I.e. between trip1.L2R and trip2.L2R there was a trip trip1.R2L without passengers.