Skip to content

Implementation of Water Jug Problem in AI using BFS and DFS

Notifications You must be signed in to change notification settings

AnkitBorude/Water_Jug

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 

Repository files navigation

Water Jug Problem in AI

In this Project , I Solved the famous Water Jug Problem in the Artificial Intellegience with bruteforce stratergy using BFS and DFS Algorithm (i.e. Uninformed search stratergy) to search through possible state space for Desired Goal State. TheMain.java File is the starting point of the program.

  • We need to choose the required engine(i.e Algorithm) by assigning Object of BFS or DFS class implementing IEngine Interface. Note.:- We have to provide the maximum depth for DFS algorithm, where DFS algorithm would go to the given depth at one side and then it would start backtracking.
  • Next we need to create Object of Jugs by providing maximum capacity of Jugs(jug1,jug2).ie.Jugs(4,3)
  • Next we need to define initial State of the Jugs and Goal State of Jugs through Jugs.State class.
  • In the end we need to create Object of ProductionSystem and pass the jugs object,initial state, final state, and engine for searching(i.e. Object of Searching Algorithm) and that its.

Thank You

About

Implementation of Water Jug Problem in AI using BFS and DFS

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages