River crossing puzzle

Last updated
Dog, sheep, and cabbage Animation of Cabbage, Sheep and Dog Crossing the River.png
Dog, sheep, and cabbage

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] The setting may vary cosmetically, for example, by replacing the river by a bridge. [1] 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 fox, goose, and bag of beans puzzle and the jealous husbands problem. [2]

Contents

Solutions to some puzzles charted as timelines

Well-known river-crossing puzzles include:

These problems may be analyzed using graph-theoretic methods, [4] [5] by dynamic programming, [6] or by integer programming. [3]

Graph theoretic formulation

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 . [7]

Csorba, Hurkens, and Woeginger proved in 2008 that determining which of or holds is NP-hard. [5] 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. [5]

See also

Related Research Articles

<span class="mw-page-title-main">Graph coloring</span> Methodic assignment of colors to elements of a graph

In graph theory, graph coloring is a special case of graph labeling; it is an assignment of labels traditionally called "colors" to elements of a graph subject to certain constraints. In its simplest form, it is a way of coloring the vertices of a graph such that no two adjacent vertices are of the same color; this is called a vertex coloring. Similarly, an edge coloring assigns a color to each edge so that no two adjacent edges are of the same color, and a face coloring of a planar graph assigns a color to each face or region so that no two faces that share a boundary have the same color.

<span class="mw-page-title-main">Weierstrass elliptic function</span> Class of mathematical functions

In mathematics, the Weierstrass elliptic functions are elliptic functions that take a particularly simple form. They are named for Karl Weierstrass. This class of functions are also referred to as ℘-functions and they are usually denoted by the symbol ℘, a uniquely fancy script p. They play an important role in the theory of elliptic functions, i.e., meromorphic functions that are doubly periodic. A ℘-function together with its derivative can be used to parameterize elliptic curves and they generate the field of elliptic functions with respect to a given period lattice.

<span class="mw-page-title-main">Vertex cover</span> Subset of a graphs vertices, including at least one endpoint of every edge

In graph theory, a vertex cover of a graph is a set of vertices that includes at least one endpoint of every edge of the graph.

In the mathematical discipline of graph theory, a matching or independent edge set in an undirected graph is a set of edges without common vertices. In other words, a subset of the edges is a matching if each vertex appears in at most one edge of that matching. Finding a matching in a bipartite graph can be treated as a network flow problem.

<span class="mw-page-title-main">Antimatroid</span> Mathematical system of orderings or sets

In mathematics, an antimatroid is a formal system that describes processes in which a set is built up by including elements one at a time, and in which an element, once available for inclusion, remains available until it is included. Antimatroids are commonly axiomatized in two equivalent ways, either as a set system modeling the possible states of such a process, or as a formal language modeling the different sequences in which elements may be included. Dilworth (1940) was the first to study antimatroids, using yet another axiomatization based on lattice theory, and they have been frequently rediscovered in other contexts.

In combinatorics, a Sperner family, or clutter, is a family F of subsets of a finite set E in which none of the sets contains another. Equivalently, a Sperner family is an antichain in the inclusion lattice over the power set of E. A Sperner family is also sometimes called an independent system or irredundant set.

<span class="mw-page-title-main">Wolf, goat and cabbage problem</span> River crossing puzzle

The wolf, goat and cabbage problem is a river crossing puzzle. It dates back to at least the 9th century, and has entered the folklore of several cultures.

The missionaries and cannibals problem, and the closely related jealous husbands problem, are classic river-crossing logic puzzles. The missionaries and cannibals problem is a well-known toy problem in artificial intelligence, where it was used by Saul Amarel as an example of problem representation.

<span class="mw-page-title-main">Dominating set</span> Subset of a graphs nodes such that all other nodes link to at least one

In graph theory, a dominating set for a graph G is a subset D of its vertices, such that any vertex of G is in D, or has a neighbor in D. The domination numberγ(G) is the number of vertices in a smallest dominating set for G.

<span class="mw-page-title-main">Link (simplicial complex)</span>

The link in a simplicial complex is a generalization of the neighborhood of a vertex in a graph. The link of a vertex encodes information about the local structure of the complex at the vertex.

In graph theory, a connected graph is k-edge-connected if it remains connected whenever fewer than k edges are removed.

<span class="mw-page-title-main">Kőnig's theorem (graph theory)</span> Theorem showing that maximum matching and minimum vertex cover are equivalent for bipartite graphs

In the mathematical area of graph theory, Kőnig's theorem, proved by Dénes Kőnig, describes an equivalence between the maximum matching problem and the minimum vertex cover problem in bipartite graphs. It was discovered independently, also in 1931, by Jenő Egerváry in the more general case of weighted graphs.

<span class="mw-page-title-main">Parity game</span> Mathematical game played on a directed graph

A parity game is played on a colored directed graph, where each node has been colored by a priority – one of (usually) finitely many natural numbers. Two players, 0 and 1, move a token along the edges of the graph. The owner of the node that the token falls on selects the successor node. The players keep moving the token, resulting in a path, called a play.

<span class="mw-page-title-main">Triadic closure</span>

Triadic closure is a concept in social network theory, first suggested by German sociologist Georg Simmel in his 1908 book Soziologie [Sociology: Investigations on the Forms of Sociation]. Triadic closure is the property among three nodes A, B, and C, that if the connections A-B and A-C exist, there is a tendency for the new connection B-C to be formed. Triadic closure can be used to understand and predict the growth of networks, although it is only one of many mechanisms by which new connections are formed in complex networks.

In computational complexity theory and combinatorics, the token reconfiguration problem is a reconfiguration problem on a graph with both an initial and desired state for tokens.

Whitehead's algorithm is a mathematical algorithm in group theory for solving the automorphic equivalence problem in the finite rank free group Fn. The algorithm is based on a classic 1936 paper of J. H. C. Whitehead. It is still unknown if Whitehead's algorithm has polynomial time complexity.

In graph theory, a matching in a hypergraph is a set of hyperedges, in which every two hyperedges are disjoint. It is an extension of the notion of matching in a graph.

A central problem in algorithmic graph theory is the shortest path problem. One of the generalizations of the shortest path problem is known as the single-source-shortest-paths (SSSP) problem, which consists of finding the shortest paths from a source vertex to all other vertices in the graph. There are classical sequential algorithms which solve this problem, such as Dijkstra's algorithm. In this article, however, we present two parallel algorithms solving this problem.

In game theory, a mean payoff game is a zero-sum game played on the vertices of a weighted directed graph. The game is played as follows: at the start of the game, a token is placed on one of the vertices of the graph. Each vertex is assigned to either the Maximizer of the Minimizer. The player that controls the current vertex the token is on, may choose one outgoing edge along which the tsdddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddoken moves next. In doing so, the Minimizer pays the maximizer the number that is on the edge. Then, again, the player controlling the next vertex the token gets can choose where it goes, and this continues indefinitely. The objective for the Maximizer is to maximize their long term average payoff, and the Minimizer has the opposite objective.

References

  1. 1 2 Peterson, Ivars (2003), "Tricky crossings", Science News, 164 (24), retrieved 2008-02-07.
  2. 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 .
  3. 1 2 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.
  4. Schwartz, Benjamin L. (1961), "An analytic method for the "difficult crossing" puzzles", Mathematics Magazine, 34 (4): 187–193, doi:10.2307/2687980, JSTOR   2687980 .
  5. 1 2 3 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 .
  6. 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 .
  7. Numberphile (2018-01-05). River Crossings (and Alcuin Numbers) - Numberphile . Retrieved 2024-05-17 via YouTube.