Ask Question, Ask an Expert

+1-415-315-9853

info@mywordsolution.com

Ask Computer Engineering Expert

For this assignment you will study and implement Korf’s algorithm for finding optimal solutions to random instances of Rubik’s Cube. Included with the assignment is a copy of Korf’s original paper. You should begin by reading the paper. Korf initially suggest using an iterative deepening version of A* (IDA*) with the heuristic. However, he points out that the inaccuracy of this heuristic results in too many nodes generated and therefore too much time to compute a solution. His answer to this problem is to precompute the heuristic for three components of the cube (corners, sides, sides) and store the values in a table. If these tables are small enough to be kept in memory, they can be referenced as part of the heuristic function. The assignment then breaks down into two steps:

1. Precompute the three tables for Korf’s heuristic and store the tables in a file. Be sure to choose a representation that is memory-efficient.

2. prepare a program that takes an arbitrary cube state as input and outputs an optimal solution move sequence. Your program should read in the tables that you precomputed, and use IDA* and Korf’s heuristic to find the solution.

I/O

For both input and output we will use the letters {R, O, Y, G, B, W} to represent the colors {Red, Orange, Yellow, Green, Blue, White}, respectively.

Input

For input your program should take the name of a file that will contain an arbitrary cube state. The file will contain a specific two dimensional representation of the cube, using the letters above to describe each cube face. The structure of the two dimensional representation will be as follows:

1850_cube face.jpg


Sample Files
The goal state would be:                             A valid non-goal state would be:
RRR                                                                    GGW
RRR                                                                    RRG
RRR                                                                    RRG                                                              
GGGYYYBBB                                                   OWWGGOYYR
GGGYYYBBB                                                   OGOYYYRBR
GGGYYYBBB                                                   YYYRBGRWW
OOO                                                                  BOY
OOO                                                                  BOB
OOO                                                                  BOB
WWW                                                                OGO
WWW                                                                WWB
WWW                                                                WWB

All spaces should be ignored when reading the files. Note that the six center faces are always the same in any valid state.
Invalid States

Not all arrangements of the faces are reachable from the goal state. The first thing your program should do is check that the input state is valid. If not, the program should output a message indicating that the state is invalid and terminate.

Output

Your program should output the optimal solution sequence for the input state as a string to standard input. The format of the solution sequence will be a string with two characters per move. The first character will be the color of the center cubie of the face to be rotated. The second character will be the number of 90° clockwise rotations, i.e. ∈ {1, 2, 3}. E.g., for the above non-goal state, the optimal solution would be O1W1R1Y3.

Language

You may use a programming language of your choice for this assignment. You are responsible for choosing a programming language and making it work. If you plan to use a non-standard language, be sure to start early so you have time to change languages if your approach does not work.

Report

In addition to the source code, report must contains the following:

• Explanation of your approach for computing and storing the tables

• Details about the tables, including number of entries and memory requirements

• Instructions for running your program

• Solutions for the ten sample states (to be provided)

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M91571

Have any Question? 


Related Questions in Computer Engineering

A class x has 12 operations cyclomatic complexity has been

A class X has 12 operations. Cyclomatic complexity has been computed for all operationsin the OO system, and the average value of module complexity is 4. For class X, the complexityfor operations 1 to 12 is 5, 4, 3, 3, 6 ...

In this exercise we illustrate the problem of using

In this exercise, we illustrate the problem of using nonprobabilistic cryptosystems, such as schoolbook RSA, imprudently. Nonprobabilistic means that the same sequence of plaintext letters maps to the same ciphertext. Th ...

1 write findmin and findmax methods for the avltree class2

1. Write FindMin and FindMax methods for the AVLTree class. 2. Using the Timing class, compare the times for the methods implemented in Exercise 1 to the same methods in the BinarySearchTree class. Your test program shou ...

Task descriptionproject animationusing adobe after effects

TASK DESCRIPTION Project: Animation Using Adobe After Effects students are to create an animation. LEARNING OUTCOMES - Produce documents and present work in multimedia formats appropriate for the intended audience. - App ...

1 prove or show that the worst case time of the extraction

1. Prove or show that the worst case time of the extraction operation on a heap implemented as an array is O(log n). 2. Prove or show that the insertion and extraction operations on a heap implemented as a Python list is ...

What functions does the internal security consultant

What functions does the internal security consultant perform, and what are the key qualifications and requirements for the position? What is the rationale for acquiring professional credentials? List and describe the cer ...

Research paper1describe three factors that help to

Research Paper 1. Describe three factors that help to influence our nation's focus on natural or man-made disasters. 2. What issues have been raised concerning some of the authorities granted to government agencies in th ...

Assignmentgame scissors rock paper write a program that

Assignment (Game: scissors, rock, paper) Write a program that plays the popular scissor-rock-paper game. (A scissor can cut a paper, a rock can knock a scissor, and a paper can wrap a rock.) The program randomly generate ...

The input stream to a 4b5b block encoder is 0100 0000 0000

The input stream to a 4B/5B block encoder is 0100 0000 0000 0000 0000 0001 Answer the following questions: a. What is the output stream? b. What is the length of the longest consecutive sequence of 0s in the input? c. Wh ...

1 the sequential search algorithm will always find the

1. The sequential search algorithm will always find the first occurrence of an item in a data set. Create a new sequential search method that takes a second integer argument indicating which occurrence of an item you wan ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

WalMart Identification of theory and critical discussion

Drawing on the prescribed text and/or relevant academic literature, produce a paper which discusses the nature of group

Section onea in an atwood machine suppose two objects of

SECTION ONE (a) In an Atwood Machine, suppose two objects of unequal mass are hung vertically over a frictionless

Part 1you work in hr for a company that operates a factory

Part 1: You work in HR for a company that operates a factory manufacturing fiberglass. There are several hundred empl

Details on advanced accounting paperthis paper is intended

DETAILS ON ADVANCED ACCOUNTING PAPER This paper is intended for students to apply the theoretical knowledge around ac

Create a provider database and related reports and queries

Create a provider database and related reports and queries to capture contact information for potential PC component pro