Skip to content

A solution to the Wolf-Goat-Cabbage Problem for CPTR430("Artificial Intelligence") using a tree

Notifications You must be signed in to change notification settings

SvenHoeffler/Wolf-Goat-Cabbage-Problem

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

Wolf-Goat-Cabbage-Problem

A solution to the Wolf-Goat-Cabbage Problem for CPTR430("Artificial Intelligence") using a tree. The solution-finding algorithms are BFS and DFS.

Problem

A farmer with a wolf, a goat, and a container of cabbage are on the west bank of the river. On the river is a boat in which the farmer and one of the other three (wolf, goat, or cabbage) can fit. If the wolf is left alone with the goat, the wolf will eat the goat. If the goat is left alone with the container of cabbage, the goat will eat the cabbage. Your goal is to transfer everyone to the other side of the river safely.

Getting Started

Below details how to run this assignment.

Prerequisites

Python3

Running the Program

Run the main.py file using python3.

python 3 main.py

Solution Output

The solution will be output as a sequential array of the states of the problem. Note that the first array is the West bank, the second array is the East bank, and the Right or Left is the side the boat is on. The farmer is always on the side of the boat.

Authors

About

A solution to the Wolf-Goat-Cabbage Problem for CPTR430("Artificial Intelligence") using a tree

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%