项目作者: SauravBrahma

项目描述 :
This script solves game with depth-first search and width-first search.
高级语言: Python
项目地址: git://github.com/SauravBrahma/GameSearch.git
创建时间: 2018-07-14T12:23:53Z
项目社区:https://github.com/SauravBrahma/GameSearch

开源协议:

下载


GameSearch

This script solves game with depth-first search and breadth-first search.

Description

This script was made to slove a question below.

Question

Question image

question

You have pails each can have 16, 9, 7 liter.
Now 16L pail is filled with water. You have to divide these into 8L and 8L respectively.
And you know minimum number of steps are 15.
But you can’t throw water away, and fill up again. (This is not “Die Hard: With a Vengeance”!) The picture below is the answer.

Answer image

answer

Execution Time

The numbers below are average execution times(second) in my environment.

  • depth : 0.0015
  • breadth : 0.0032