A river crossing puzzle is a type of puzzle in which the object is to carry items from one
river bank
In geography, a bank is the land alongside a body of water.
Different structures are referred to as ''banks'' in different fields of geography.
In limnology (the study of inland waters), a stream bank or river bank is the terrain alongsid ...
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.
[.] The setting may vary cosmetically, for example, by replacing the river by a bridge.
The earliest known river-crossing problems occur in the manuscript ''
Propositiones ad Acuendos Juvenes The medieval Latin manuscript ''Propositiones ad Acuendos Juvenes'' () is one of the earliest known collections of recreational mathematics problems.Alcuin
Alcuin of York (; ; 735 – 19 May 804), also called Ealhwine, Alhwin, or Alchoin, was a scholar, clergyman, poet, and teacher from York, Northumbria. He was born around 735 and became the student of Ecgbert of York, Archbishop Ecgbert at Yor ...
. 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
The missionaries and cannibals problem, and the closely related jealous husbands problem, are classic river-crossing problems, river-crossing logic puzzles. The missionaries and cannibals problem is a well-known toy problem in artificial intellige ...
.
Well-known river-crossing puzzles include:
* The
fox, goose, and bag of beans puzzle, in which a farmer must transport a fox, goose and bag of beans from one side of a river to another using a boat which can only hold one item in addition to the farmer, subject to the constraints that the fox cannot be left alone with the goose, and the goose cannot be left alone with the beans. Equivalent puzzles have also been stated involving a fox, chicken, and bag of grain, or a
wolf, goat, and cabbage, etc.
* The
jealous husbands problem
The missionaries and cannibals problem, and the closely related jealous husbands problem, are classic river-crossing problems, river-crossing logic puzzles. The missionaries and cannibals problem is a well-known toy problem in artificial intellige ...
, in which three
married couples
Marriage, also called matrimony or wedlock, is a culturally and often legally recognised union between people called spouses. It establishes rights and obligations between them, as well as between them and their children (if any), and b ...
must cross a river using a boat which can hold at most two people, subject to the constraint that no woman can be in the presence of another man unless her husband is also present. This is similar to 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.
* The
bridge and torch problem
The bridge and torch problem (also known as ''The Midnight Train'' and ''Dangerous crossing'') is a logic puzzle that deals with four people, a bridge and a torch. It is in the category of river crossing puzzles, where a number of objects must mo ...
.
* ''Propositio de viro et muliere ponderantibus plaustrum''. In this problem, also occurring in ''
Propositiones ad Acuendos Juvenes The medieval Latin manuscript ''Propositiones ad Acuendos Juvenes'' () is one of the earliest known collections of recreational mathematics problems.graph-theoretic
In mathematics and computer science, graph theory is the study of ''graphs'', which are mathematical structures used to model pairwise relations between objects. A graph in this context is made up of '' vertices'' (also called ''nodes'' or ''poi ...
methods,
[.] by
dynamic programming, or by
integer programming
An integer programming problem is a mathematical optimization or feasibility program in which some or all of the variables are restricted to be integers. In many settings the term refers to integer linear programming (ILP), in which the objective ...
.
[.]
Graph theoretic formulation
Let
be an
undirected graph
In discrete mathematics, particularly in graph theory, a graph is a structure consisting of a set of objects where some pairs of the objects are in some sense "related". The objects are represented by abstractions called '' vertices'' (also call ...
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
In graph theory, a vertex cover (sometimes node cover) of a graph is a set of vertices that includes at least one endpoint of every edge of the graph.
In computer science, the problem of finding a minimum vertex cover is a classical optimizat ...
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
.
Csorba, Hurkens, and Woeginger proved in 2008 that determining which of
or
holds is
NP-hard
In computational complexity theory, a computational problem ''H'' is called NP-hard if, for every problem ''L'' which can be solved in non-deterministic polynomial-time, there is a polynomial-time reduction from ''L'' to ''H''. That is, assumi ...
.
Because the
minimum vertex cover problem is
NP-complete
In computational complexity theory, NP-complete problems are the hardest of the problems to which ''solutions'' can be verified ''quickly''.
Somewhat more precisely, a problem is NP-complete when:
# It is a decision problem, meaning that for any ...
, it follows that computing the Alcuin number of a graph
is
NP-hard
In computational complexity theory, a computational problem ''H'' is called NP-hard if, for every problem ''L'' which can be solved in non-deterministic polynomial-time, there is a polynomial-time reduction from ''L'' to ''H''. That is, assumi ...
. 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
In theoretical computer science, the time complexity is the computational complexity that describes the amount of computer time it takes to run an algorithm. Time complexity is commonly estimated by counting the number of elementary operations p ...
(though determining either
or
remains NP-hard); for
bipartite graphs
In the mathematical field of graph theory, a bipartite graph (or bigraph) is a graph whose vertices can be divided into two disjoint and independent sets U and V, that is, every edge connects a vertex in U to one in V. Vertex sets U and V a ...
,
and
can both be computed exactly in polynomial time.
See also
*
Vertex cover
In graph theory, a vertex cover (sometimes node cover) of a graph is a set of vertices that includes at least one endpoint of every edge of the graph.
In computer science, the problem of finding a minimum vertex cover is a classical optimizat ...
References
External links
YouTube video
{{DEFAULTSORT:River Crossing Puzzle
Logic puzzles