Concluído

8-puzzle in Python with bfs (Breadth First Search); dfs (Depth First Search); ast (A Star Search) solvers

Solves any 8-puzzle in PYTHON 2, when given an arbitrary starting configuration.

Starting:

| 1 | 2 | 5 |

| 3 | 4 | 0 |

| 6 | 7 | 8 |

Goal:

| 0 | 1 | 2 |

| 3 | 4 | 5 |

| 6 | 7 | 8 |

The program will be executed as follows:

$ python [url removed, login to view] <method> <board>

The method argument will be one of the following but all have to be implemented

bfs (Breadth-First Search)

dfs (Depth-First Search)

ast (A-Star Search)

The board argument will be a comma-separated list of integers containing no spaces.

For example, to use the bread-first search strategy to solve the input board given by the starting configuration {0,8,7,6,5,4,3,2,1}, the program will be executed like so (with no spaces between commas):

$ python [url removed, login to view] bfs 0,8,7,6,5,4,3,2,1

When executed, the program will create / write to a file called [url removed, login to view], containing the following statistics:

path_to_goal: the sequence of moves taken to reach the goal

cost_of_path: the number of moves taken to reach the goal

nodes_expanded: the number of nodes that have been expanded

search_depth: the depth within the search tree when the goal node is found

max_search_depth: the maximum depth of the search tree in the lifetime of the algorithm

running_time: the total running time of the search instance, reported in seconds

max_ram_usage: the maximum RAM usage in the lifetime of the process as measured by the ru_maxrss attribute in the resource module, reported in megabytes

The command

$ python [url removed, login to view] bfs 1,2,5,3,4,0,6,7,8

has to give ([url removed, login to view])

path_to_goal: ['Up', 'Left', 'Left']

cost_of_path: 3

nodes_expanded: 10

search_depth: 3

max_search_depth: 4

running_time: 0.00188088

max_ram_usage: 0.07812500

the command

$ python [url removed, login to view] dfs 1,2,5,3,4,0,6,7,8

has to give ([url removed, login to view])

path_to_goal: ['Up', 'Left', 'Left']

cost_of_path: 3

nodes_expanded: 181437

search_depth: 3

Habilidades: Inteligência Artificial, Python

Veja mais: depth first search and breadth first search with example, breadth-first search bfs, breadth first search and depth first search, 8 puzzle problem using bfs in java, 8 puzzle solver code in python, 8-puzzle game python bfs, 8 puzzle depth first search, 8 puzzle using a * algorithm python, 8 puzzle problem using breadth first search, 8 puzzle code in python, 8 puzzle bfs c++, python, algorithm, programming, bfs and dfs program in java, bfs and dfs java code, bfs and dfs in java, bfs and dfs in data structure, bfs and dfs examples, bfs and dfs code in java

Acerca do Empregador:
( 0 comentários ) Germany

ID do Projeto: #15260987

Concedido a:

jeevansai502

I am a coder and will give you the code. Relevant Skills and Experience I am a coder. Proposed Milestones €30 EUR - Code

€30 EUR em 1 dia
(0 Comentários)
0.0

4 freelancers estão ofertando em média €53 para esse trabalho

€50 EUR em 1 dia
(36 Comentários)
4.9
Magicspell

To solve 8-puzzle problem using python. 7 years of programming experience including perticipation of various programming contest. And an embedded system engineer. Relevant Skills and Experience Python, Algorithm, Data Mais

€100 EUR in 2 dias
(2 Comentários)
2.7
dilichan

I am an undergraduate with knowledge with algorithms such as A* search, wave front, etc. Moreover I am good with coming up with algorithmic solutions and coding them. I am certain i can do this task. Relevant Skills a Mais

€30 EUR em 1 dia
(0 Comentários)
1.5