Skip to content

AakashTyagi11/AI-Puzzle-Problems

Repository files navigation

AI-Puzzle-Problems

Implemented a solution in Java using all the search algorithms that work on the particular problem. Reported solution cost and number of expansions for each search algorithm that is able to (quickly) terminate on a problem.

Wolf-goat-cabbage riddle

A farmer wants to cross a river and take with him a wolf, a goat, and a cabbage.There is a boat that can fit himself plus either the wolf, the goat, or the cabbage. If the wolf and the goat are alone on one shore, the wolf will eat the goat. If the goat and the cabbage are alone on the shore, the goat will eat the cabbage.How can the farmer bring the wolf, the goat, and the cabbage across the river?

Missionaries and cannibals problem

In the missionaries and cannibals problem, three missionaries and three cannibals must cross a river using a boat which can carry at most two people, under the constraint that, for both banks, if there are missionaries present on the bank, they cannot be outnumbered by cannibals (if they were, the cannibals would eat the missionaries). The boat cannot cross the river by itself with no people on board. Find a sequence of boat trips that will permit all the missionaries and cannibals to cross the river safely.

Pancake Sorting Problem

We are given a stack of n pancakes, each of different size. Our goal is to sort this stack from smallest to largest (largest being on the bottom of the stack). The only thing we are allowed to do is to insert the spatula in between two pancakes (or between the bottom pancake and the plate), and flip over all the pancakes that are on top of the spatula.

About

Implemented solutions using search algorithms for riddles like Wolf-Goat-Cabbage, Missionaries-Cannibals, and Pancake sorting problem.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages