Take the goat across first: it is the only safe opening passenger, and the shortest route takes seven crossings.
That opening choice works because the wolf and cabbage may remain together without supervision, while the goat cannot remain with either of them. The farmer must pilot every crossing and can carry at most one passenger, so the rest of the solution depends on choosing a safe return as carefully as the next outward trip. The browser-based River Crossing Puzzle gives explicit feedback when a selection would be unsafe, making the decision rule straightforward to apply.

Check both banks before selecting a passenger
Use the same two-part test before every move. First, the selected passenger must begin on the same bank as the farmer. Second, imagine the crossing as completed and check every bank that will not contain the farmer. A bank holding the wolf and goat is unsafe, and a bank holding the goat and cabbage is unsafe. A bank holding the wolf and cabbage is safe.
At the opening position, this comparison makes the correct first choice clear:
| Opening choice | Items left without the farmer | Safety result |
|---|---|---|
| Take wolf | Goat and cabbage | Illegal |
| Take goat | Wolf and cabbage | Legal |
| Take cabbage | Wolf and goat | Illegal |
| Take farmer alone | Wolf, goat, and cabbage | Illegal |
Later moves require more thought because the farmer changes banks. Instead of asking only whether the current cargo seems safe, inspect the arrangement that the proposed trip would create. The useful question is: after everyone reaches their destination, which dangerous pair would be left without the farmer?
Build the route one legal crossing at a time
The following seven-crossing sequence is the direct route to the goal:
- Take the goat to the far bank. The wolf and cabbage remain together on the near bank, which is safe without the farmer.
- Return with the farmer alone. The farmer goes back to collect another passenger while the goat stays on the far bank.
- Take the wolf to the far bank. The farmer can now supervise the wolf and goat together. The cabbage remains alone on the near bank.
- Bring the goat back. This apparently backward move is necessary: the farmer and goat return to the near bank, where the goat can safely remain with the cabbage while the wolf stays across.
- Take the cabbage to the far bank. The wolf and cabbage can share the far bank, while the goat remains supervised on the near bank.
- Return with the farmer alone. Leaving the wolf and cabbage together is safe, so the farmer can go back for the goat.
- Take the goat to the far bank. All four entities are now across, completing the puzzle.
There are two equally short versions of this plan. The other route makes the same outward cargo trips in the opposite order: take the goat first, then take the cabbage across before the wolf, bring the goat back, and carry the wolf across before returning alone for the goat. Both shortest routes use seven crossings.
Choose by looking one move ahead
A legal move is not automatically the most efficient move. Some legal choices simply reverse earlier progress, while another legal edge may reposition the farmer for a useful trip. The important distinction is whether the new arrangement creates access to the goal without creating a wasteful cycle.
The game represents each arrangement with four bits in farmer, wolf, goat, and cabbage order. A zero means the near bank and a one means the far bank, so the initial position is 0000 and the goal is 1111. The safety rules leave 10 valid arrangements. A legal crossing forms an edge between two of those arrangements, including return trips.
Breadth-first search explores this graph one crossing at a time. It first reaches 1111 at depth seven and finds the two shortest routes. A separate numeric-bit search independently confirms the same minimum and route set. For a player, the practical version of this method is simple: take a legal move, look at the resulting arrangement, and prefer the edge that prepares the next useful cargo trip rather than undoing the position you just reached.
This state-graph perspective is also used in educational treatments of the classic problem. The Julia Robinson Mathematics Festival river crossings activity describes the puzzle through a state-transition graph, while Margaret Fleck’s University of Illinois state-diagrams text independently develops the same puzzle as an example of state diagrams.
Use touch or keyboard controls without changing the logic
On a touchscreen, select one of the four choices—Farmer alone, Take wolf, Take goat, or Take cabbage—and then activate the crossing button. The controls use native, touch-friendly buttons, and the bank labels expose each token’s current location.
Keyboard play follows the same workflow. Use Left or Up Arrow to move to the previous passenger option and Right or Down Arrow to move to the next. Press Enter or Space to cross with the selected option. Number keys provide direct shortcuts: 1 crosses with the farmer alone, 2 with the wolf, 3 with the goat, and 4 with the cabbage. These shortcuts do not bypass the safety rule; an attempted shortcut still produces feedback if it would be illegal.
The boat indicator always points toward the next crossing and always stays with the farmer because no animal or vegetable can pilot it. Use the bank labels as the primary positional information rather than relying on the boat icon alone.
Recover from an illegal selection
An illegal attempt can fail for either of two distinct reasons:
- The passenger is on the wrong bank. If the selected passenger is opposite the farmer, the farmer, passenger, boat, and crossing counter remain where they were. The feedback identifies the wrong-bank problem.
- The result would strand a dangerous pair. If the proposed crossing would leave the wolf with the goat or the goat with the cabbage without supervision, no positions change and the crossing counter does not increase. The feedback names the safety problem instead of pretending the crossing happened.
Each illegal attempt counts as one mistake. After the first, the route remains editable, so select a different passenger and continue. A second illegal attempt deadlocks the run until you choose Restart. Restart returns all four entities to the near bank, places the boat with the farmer, selects the goat as the initial choice, and resets the crossings, mistakes, score, and feedback.
Use seven crossings as a target, not a scoring requirement
The goal is to move the farmer, wolf, goat, and cabbage to the far bank. Any safe route that reaches that goal completes the game and awards exactly 1,000 points. Seven crossings is the disclosed shortest length, but a longer legal route can also finish; the score does not penalize extra crossings or claim that a longer solution is impossible.
Legal walks may revisit earlier arrangements, so a player can deliberately undo progress and still complete the puzzle later. Completion and deadlock are frozen terminal states: further selections or crossings do not alter the result. The fixed reward, two-error stop, and restart behavior belong to this implementation rather than the historic riddle. To understand why the point total should not be read as a performance rating, see why the River Crossing Puzzle reward is fixed rather than an ability test.
Related reading: How to Avoid Common Mistakes in Rotating Picture Puzzle.