A Comparative Study of Breadth First Search and Depth First Search Algorithms in Solving the Water Jug Problem on Google Colab

Main Article Content

Rahul Jain
https://orcid.org/0009-0001-3502-2678

Abstract

The Water Jug Problem, also known as the Die-Hard Problem, is a well-known artificial intelligence problem that involves filling and pouring water from two jugs of different capacities to obtain a specific amount of water. In this research, we investigate the performance of two search algorithms, namely Breadth First Search (BFS) and Depth First Search (DFS), in solving the Water Jug Problem on Google Colab. We define the rules of the problem and implement the BFS and DFS algorithms to find the optimal path from an initial node to a goal node. We compare the execution time and the number of explored nodes for each algorithm to evaluate their efficiency and effectiveness. The results show that the BFS algorithm performs better than the DFS algorithm in terms of execution time and explored nodes. The findings of this research contribute to the understanding of search algorithms and their applicability in solving real-world problems.


 

Article Details

How to Cite
Jain, R. (2023). A Comparative Study of Breadth First Search and Depth First Search Algorithms in Solving the Water Jug Problem on Google Colab. Advances in AI, 1(1). Retrieved from https://aaijournal.jamesriverfoundation.org/index.php/aai/article/view/2
Section
Articles
Author Biography

Rahul Jain, UV Patel College of Engineering Ganpat University