River crossing puzzle

A river crossing puzzle is a type of puzzle in which the object is to carry items from one river bank to another, usually in the fewest trips. The difficulty of the puzzle may arise from restrictions on which or how many items can be transported at the same time, or which or how many items may be safely left together.[1][2] The setting may vary cosmetically, for example, by replacing the river by a bridge.[2] The earliest known river-crossing problems occur in the manuscript Propositiones ad Acuendos Juvenes (English: Problems to sharpen the young), traditionally said to be written by Alcuin. The earliest copies of this manuscript date from the 9th century; it contains three river-crossing problems, including the wolf, goat and cabbage problem and the missionaries and cannibals problem.[3]
Well-known river-crossing puzzles include:
- The wolf, goat and cabbage problem, in which a wolf, goat and cabbage must cross the river in a boat but the neither the goat and cabbage, or wolf and goat can be alone together. The puuzzle can also be formulated as a fox, goose, and bag of beans puzzle.
- The missionaries and cannibals problem, in which three missionaries and three cannibals must cross the river, with the constraint that at any time when both missionaries and cannibals are standing on either bank, the cannibals on that bank may not outnumber the missionaries. Also formulated as the jealous husbands problem
- The bridge and torch problem in which four people come to a river in the night. There is a narrow bridge, and it can only hold two people at a time. They have one torch and, because it's night, the torch has to be used when crossing the bridge.
- Propositio de viro et muliere ponderantibus plaustrum. In this problem, also occurring in Propositiones ad Acuendos Juvenes, a man and a woman of equal weight, together with two children, each of half their weight, wish to cross a river using a boat which can only carry the weight of one adult.[4]
These problems may be analyzed using graph-theoretic methods,[5][6] by dynamic programming,[7] or by integer programming.[4]
Graph theoretic formulation
[edit]Let be an undirected graph whose vertex set represents items that the farmer must carry, and whose edge set consists of pairs of items that conflict. For example, if a vertex represents a goose and the bag of beans, then the two vertices would be connected since the goose cannot be left on the same side of the river with a bag of beans. Note that the edges are undirected, as the nature of the conflict between the two items does not affect the fact that they cannot be left on the same side of the river. The object of the problem is to determine the minimum size of the boat such that a trip is feasible; this is known as the Alcuin number of .
Consider a successful river crossing in which the farmer first carries a subset of items across the river, leaving the remaining items on the shore. Because the trip is successful, there must be no conflicts in the items left onshore; ie. in , there are no edges in between any two elements of . This implies that all edges have one or both vertices in , ie. that is a vertex cover of . Therefore, the size of the boat must be at least as large as the size of the minimum vertex cover of ; this forms a lower bound on the Alcuin number of : .
On the other hand, it is possible to complete a successful trip with boat size equal to . This can be achieved by requiring the members of a minimum vertex cover to remain on the boat at all times; these items number , and thus leave one more space on the boat. Because there are no conflicts among any of the remaining items, they can be taken across the river one at a time in any order, occupying the one remaining space on the boat. Thus, , forming an upper bound for . Combining these together, we have , ie. either or .[1]
Csorba, Hurkens, and Woeginger proved in 2008 that determining which of or holds is NP-hard.[6] Because the minimum vertex cover problem is NP-complete, it follows that computing the Alcuin number of a graph is NP-hard. However, for certain classes of graphs, stronger results hold. For example, for planar graphs, determining which of the two relations holds can be done in polynomial time (though determining either or remains NP-hard); for bipartite graphs, and can both be computed exactly in polynomial time.[6]
References
[edit]- ^ a b Numberphile (2018-01-05). River Crossings (and Alcuin Numbers) - Numberphile. Retrieved 2024-05-17 – via YouTube.
- ^ a b Peterson, Ivars (2003), "Tricky crossings", Science News, 164 (24), retrieved 2008-02-07.
- ^ p. 74, Pressman, Ian; Singmaster, David (1989), ""The Jealous Husbands" and "The Missionaries and Cannibals"", The Mathematical Gazette, 73 (464), The Mathematical Association: 73–81, doi:10.2307/3619658, JSTOR 3619658.
- ^ a b Borndörfer, Ralf; Grötschel, Martin; Löbel, Andreas (1995), Alcuin's Transportation Problems and Integer Programming, Preprint SC-95-27, Konrad-Zuse-Zentrum für Informationstechnik Berlin, archived from the original on 2011-07-19.
- ^ Schwartz, Benjamin L. (1961), "An analytic method for the "difficult crossing" puzzles", Mathematics Magazine, 34 (4): 187–193, doi:10.2307/2687980, JSTOR 2687980.
- ^ a b c Csorba, Péter; Hurkens, Cor A. J.; Woeginger, Gerhard J. (2008), "The Alcuin number of a graph", Algorithms: ESA 2008, Lecture Notes in Computer Science, vol. 5193, Springer-Verlag, pp. 320–331, doi:10.1007/978-3-540-87744-8_27.
- ^ Bellman, Richard (1962), "Dynamic programming and "difficult crossing" puzzles", Mathematics Magazine, 35 (1), Mathematical Association of America: 27–29, doi:10.2307/2689096, JSTOR 2689096.