Write a program which performs Iterative Deepening a-star (IDA*) search to find the solution to any given board position for 15 puzzle using two types of heuristics: 1. Number of misplaced tiles 2. Manhattan Distance https://en.wikipedia.org/wiki/Iterative_deepening_A* Described in section 3.5.5 of the textbook. Input

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question
Write a program which performs Iterative Deepening a-star (IDA*) search to find the solution to any
given board position for 15 puzzle using two types of heuristics:
1. Number of misplaced tiles
2. Manhattan Distance
https://en.wikipedia.org/wiki/Iterative_deepening_A*
Described in section 3.5.5 of the textbook.
Input
The input should be given in form of sequence of numbered tiles for initial board configuration,
'0' indicating the empty space (see example below)
Output
1. Moves
2. Number of Nodes expanded
3. Time Taken
4. Memory Used
Submission
Please upload the code to gradescope. The starter code written in python is helpful for
compatibility with gradescope autograder.
Source Code
Readme.txt including instruction to run the code, include version of compiler you are
using (e.g. java 1.8, c++11)
Transcribed Image Text:Write a program which performs Iterative Deepening a-star (IDA*) search to find the solution to any given board position for 15 puzzle using two types of heuristics: 1. Number of misplaced tiles 2. Manhattan Distance https://en.wikipedia.org/wiki/Iterative_deepening_A* Described in section 3.5.5 of the textbook. Input The input should be given in form of sequence of numbered tiles for initial board configuration, '0' indicating the empty space (see example below) Output 1. Moves 2. Number of Nodes expanded 3. Time Taken 4. Memory Used Submission Please upload the code to gradescope. The starter code written in python is helpful for compatibility with gradescope autograder. Source Code Readme.txt including instruction to run the code, include version of compiler you are using (e.g. java 1.8, c++11)
Expert Solution
Step 1

Algorithm:

  1. Initialize the search agent and provide it with an initial state of the puzzle and a chosen heuristic function (either the Manhattan distance or the misplaced tiles).
  2. The initial state is represented as a list of 16 numbers, where '0' represents the empty tile.
  3. The search agent creates a priority queue, which is initialized with the initial state of the puzzle and an empty path.
  4. The search agent also creates an empty set to keep track of the states that have already been explored.
  5. While the priority queue is not empty, the search agent dequeues the state with the highest priority (i.e., the state with the lowest heuristic value) and its corresponding path.
  6. If the dequeued state is the goal state (i.e., all tiles are in their correct position), the search agent returns the path to reach that state, and the number of nodes expanded during the search.
  7. If the dequeued state is not the goal state, the search agent generates all possible successor states by moving the empty tile in all possible directions (left, right, up, and down).
  8. For each successor state, the search agent calculates the heuristic value using the chosen heuristic function and adds the state, its path, and its heuristic value to the priority queue.
  9. The search agent also adds the dequeued state to the set of explored states.
  10. The search agent repeats steps 5-9 until the goal state is found or the priority queue is empty (i.e., all possible states have been explored).
  11. The search agent returns the path to the goal state and the number of nodes expanded during the search.
  12. The main function calls the solve method with the initial state and the chosen heuristic function, prints the moves needed to solve the puzzle, and returns the path to the goal state.
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 5 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY