subject

Implement a C program to solve the 15-puzzle problem using the A* search algorithm.

In the assignment, solving a 15-puzzle problem needs to move the tiles to their goal locations, which are as shown below. The numbers 1~15 are indexes of the tiles, and 0 means blank tile. This state is the goal state.

Your program can solve the problem using a single thread or using 4 threads, depending on the first argument (argv[1]). The program uses a single thread if argv[1] is "-s", or 4 threads if argv[1] is "-m". The initial layout of the tiles is also provided in the command line as arguments by listing tile indexes in a row-major order.

For example, the command ./your_program -s 2 3 0 4 1 6 7 8 5 9 10 12 13 14 11 15 is to use one thread to solve the 15-puzzle problem, in which the tiles are initially placed as follows, and are to be moved to their goal locations

The command ./your_program -m 2 3 0 4 1 6 7 8 5 9 10 12 13 14 11 15 is to solve the above problem using 4 threads.

Program needs to print out a sequence of states showing the movement the tiles, or text "no solution" if a solution cannot be found.

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 23:30
What are some ways to use a range name in a formula? check all that apply. in the defined names group, click use in formula, and then select the desired name. begin typing the name in the formula, select a name from the autocomplete list, and use the arrow keys and tab key to enter the name in the formula. begin typing the formula, and then click and drag with the mouse to select the cells to include in the formula. right-click one of the cells in the range. click formula options, and use the dialog box to add the name.
Answers: 1
question
Computers and Technology, 23.06.2019 02:00
Which software would you use to create a print design? a. illustrator b. audacity c. reaper d. dreamweaver
Answers: 2
question
Computers and Technology, 23.06.2019 05:20
Which operating system is a version of linux?
Answers: 1
question
Computers and Technology, 23.06.2019 09:00
Before you record your own voice, you should a. record other people's voices b. warm up and practice difficult names c. listen to your favorite songs d. read a transcript of a good radio news segment
Answers: 1
You know the right answer?
Implement a C program to solve the 15-puzzle problem using the A* search algorithm.

In...
Questions
question
Mathematics, 13.11.2020 19:50
question
English, 13.11.2020 19:50