Write cpp program that will implement a breadth-first search

Assignment Help C/C++ Programming
Reference no: EM131340419

Assignment

Write a C++ (or any other .net language) program that will implement a Breadth-First Search, a Depth-First Search, and an A* Search (using the number of misplaced tiles) to solve an 8-piece Slider Puzzle.

For this program, the above search strategies must be used to solve the 8-piece Slider Puzzle. The constraints of this project will be as they would be if the user were holding an actual, physical, version of the puzzle in their hand.

A tile cannot be removed from the environment

A tile cannot pass over or behind another tile

A tile can only be moved up, down, left or right (no diagonal moves)

A tile can only be moved into an empty space

The goal state of the puzzle should be:

1 | 2 | 3 |

4 | 5 | 6 |

7 | 8 | |

This program will need a simple menu for the user interface. This menu should include options for the user to generate a puzzle, run each of the searches against the generated puzzle, and an option to exit the program. The user interface should look something like this:

Welcome to the 8-piece Slider Solver

Please choose one of the following:

Generate a random puzzle

Run a Breadth First Search

Run a Depth First Search

Run an A* Search

Exit

Once a puzzle is generated, at least one of the searches must be run against it (the program should be able to do more than one sewrch per puzzle as well, however, this is not completely necessary). The user should choose the search. So, once a puzzle has been generated, the main menu should be called again to allow to the user to choose which search to run.

After the user chooses a search, the program should output the results. The program should keep track of what search was used, what the starting state of the puzzle was, whether a solution was found (SOME PUZZLES WILL HAVE NO SOLUTION! THE PROGRAM MUST BE ABLE TO IDENTIFY THIS AND OUTPUT THAT THE PROGRAM COULD FIND NO SOLUTION!), at what depth the solution was found, how many nodes were expanded to find the solution, and how long it took the program to find the solution. The program should then output the results of the search like so:

(Print Name of Search Used)

Staring State: (print starting state of the puzzle here)

Was a Solution found?: (print yes or no)

At what depth was the solution found?: (print depth)

How many nodes were expanded?: (print depth)

How long did the search take?: (print time)

Exit

Once the program has run a search against the generated puzzle, the program should return to the main menu so that the user can choose to generate a new puzzle, run another search on the puzzle that was already generated, or exit the program.

This program will need functions to accomplish the following (not all of these functions are necessary. Two or more can be combined into a single function. Some can be omitted entirely. These are just examples):

A function to create an interface menu for the user

A function to generate a randomized 8-piece puzzle and store it for use

A function to run a Breadth-First search

A function to run a Depth-First search

A function to run an A* search

A function to return the user to the menu after puzzle generation, error, or after running a search

A function to print the results of a search to the user (starting state, if a solution was found, depth of solution, how many nodes were expanded, time taken to finish)

A function to exit the program.

Reference no: EM131340419

Questions Cloud

What safeguards should be instituted to reduce the risk : ACCT20040 - Auditing and Ethical Practice and ACCT20075 - Auditing and Ethics Assessment Task. What action should Fellowes and Associates take to eliminate the potential threats to independence in situations (1) and (2) above? What safeguards shoul..
Negotiation gambits chart : As you prepare to write this week's discussion post, first review the article: How to Neutralise Aggressive Negotiators Tactics. Then, fill out the Negotiation Gambits Chart. Include the following information:
What is present value of this cash flow pattern : You have been offered the opportunity to invest in a project that will pay $5,640 per year at the end of years one through three and $11,382 per year at the end of years four and five . If the appropriate discount rate is 14.7 percent per year, what ..
Legislative influences on the labor relations process : Create a chart to compare and contrast the major legislative influences on the labor relations process. Your chart must contain at least five major legislative acts and how they affect management and unions. Columns should include the law, coverag..
Write cpp program that will implement a breadth-first search : Write a C++ (or any other .net language) program that will implement a Breadth-First Search, a Depth-First Search, and an A* Search (using the number of misplaced tiles) to solve an 8-piece Slider Puzzle.
Do you think my conclusion could be stronger : Do you think my conclusion could be stronger? Any tips or suggestions - discuss and critique the concluding paragraphs of at least two of your classmates.
Risk-free pure discount bond : Today is 01/01/02. On 06/30/03 we will have to make a payment of $100. We can only invest in a risk-free pure discount bond (nominal $100) that matures on 12/31/02 and in a risk-free coupon bond, nominal $100, that pays an annual coupon (on 12/31) of..
Compare confucian role ethics and care ethics : Your term paper will be on a topic of your choosing, so long as it is comparative in nature and addresses at least one of the major traditions of Asian philosophy discussed in this class. It will be worth a maximum of twenty points (the same as on..
Strategies marketers use to develop brand loyalty : How would you describe Apple's (or United Way) brand strategy? Discuss other brand strategies marketers use to develop brand loyalty. Give a detailed description of what in involved with the strategy--what are the various components?

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Create program that uses functions and reference parameters

Create program that uses functions and reference parameters, and asks user for the outside temperature.

  Write a program using vectors and iterators

Write a program using vectors and iterators that allows a user to maintain a personal list of DVD titles

  Write the code required to analyse and display the data

Calculate and store the average for each row and column. Determine and store the values for the Average Map.

  Write a webservices application

Write a webservices application that does a simple four function calculator

  Iimplement a client-server of the game

Iimplement a client-server version of the rock-paper-scissors-lizard-Spock game.

  Model-view-controller

Explain Model-View-Controller paradigm

  Design a nested program

How many levels of nesting are there in this design?

  Convert celsius temperatures to fahrenheit temperatures

Write a C++ program that converts Celsius Temperatures to Fahrenheit Temperatures.

  Evaluate and output the value in the given base

Write C program that will input two values from the user that are a Value and a Base with which you will evaluate and output the Value in the given Base.

  Design a base class shape with virtual functions

Design a base class shape with virtual functions

  Implementation of classes

Implementation of classes Chart and BarChart. Class barChart chould display a simple textual representation of the data

  Technical paper: memory management

Technical Paper: Memory Management, The intent of this paper is to provide you with an in depth knowledge of how memory is used in executing, your programs and its critical support for applications.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd