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 18:30
Which of the following commands is more recommended while creating a bot?
Answers: 1
question
Computers and Technology, 23.06.2019 02:00
In the context of an internet connection, llc stands for leased line connection liability limited company local loop complex local loop carrier
Answers: 1
question
Computers and Technology, 24.06.2019 02:00
How are we able to create photographs differently than 100 years ago? explain your answer in relation to your photograph you selected.
Answers: 1
question
Computers and Technology, 24.06.2019 04:30
Write and test a python program to find and print the largest number in a set of real (floating point) numbers. the program should first read a single positive integer number from the user, which will be how many numbers to read and search through. after reading in all of the numbers, the largest of the numbers input (not considering the count input) should be printed.
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, 19.02.2021 14:00
question
English, 19.02.2021 14:00
question
Mathematics, 19.02.2021 14:00
question
Mathematics, 19.02.2021 14:00
question
English, 19.02.2021 14:00
question
Mathematics, 19.02.2021 14:00
question
Social Studies, 19.02.2021 14:00
question
Mathematics, 19.02.2021 14:00
Questions on the website: 13722360