Graphing the chicken-fox-wheat problem

Below is a reachability graph of the chicken-fox-wheat problem, where
“===” represents the bridge, “CFMW===” is the initial state and
“===CFMW” is the non-fatal final state (the other final states are
fatal). The edge label represents what the man is taking to the other side (“M” means he’s just taking himself)

Summary: A man (M) has a chicken (C), fox (F), and a bag of wheat
(W). He has to cross a bridge, but can carry at most one item with him
(but he can also choose to carry no items). If the fox and chicken are
left alone, the fox will eat the chicken. If the chicken and the wheat
are left alone, the chicken will eat the wheat.

Source code that produced this graph: https://github.com/barrycarter/bcapps/blob/master/bc-chicken-problem.pl

This entry was posted in Programming. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *