Ask Question, Ask an Expert


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.


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.


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.


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.


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.


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

Assignment conflict resolutionconflict resolution is a

Assignment: Conflict Resolution Conflict resolution is a necessary skill for any manager or leader. In this assignment, you will examine the difference between conflict and competition. You will also explore ways of dete ...

1 design and implement an iterative version of the

1. Design and implement an iterative version of the factorial function. 2. Design and implement a recursive function for determining whether a string is a palindrome. A palindrome is a string of characters that is the sa ...

Disscussion questionsneed a paragraphs on each

Disscussion Questions Need a Paragraphs on each question Choosing a Power Supply Choosing a Motherboard Name the 9 major parts of the motherboard and describe it purpose Your group has been asked to present to a high sch ...

Modify the quicksort2 algorithm so that it generates a

Modify the quicksort2 algorithm so that it generates a histogram of the frequency of calls made for segment sizes in the range 1 to n. What conclusions can you draw from this profile?

Given alpha 0 b 1 and c 1 are the first three numbers of

Given α = 0, b = 1, and c =1 are the first three numbers of some sequence. All other numbers in the sequence are generated from the sum of their three most recent predecessors. Design an algorithm to generate this sequen ...

The rsa encryption algorithm is based on the fact that it

The RSA encryption algorithm is based on the fact that it is hard to factor a large number (250+ digits). If you were able to factor a large number quickly how would you be able to find the encryption ( e ) and decryptio ...

1 discuss four access methods giving the weaknesses of

1. Discuss four access methods, giving the weaknesses of each. 2. Discuss the many ways in which access can be abused. 3. Is it possible to implement full distributed authorization? What will be involved? 4. Web authoriz ...

Assume we store a one-time key on a cd-rom with a capacity

Assume we store a one-time key on a CD-ROM with a capacity of 1 Gbyte. Discuss the real-life implications of a One-Time-Pad (OTP) system. Address issues such as life cycle of the key, storage of the key during the life c ...

1 complete the implementation of the multiarray class by

1. Complete the implementation of the MultiArray class by implementing the helper method computeFactors(). 2. 1 In this chapter, we implemented the Set ADT using a list. Implement the Set ADT using a bag created from the ...

1 why is it important to use a structured systematic method

1. Why is it important to use a structured, systematic method for designing networks? What problems can occur if such methods are not used? 2. Compare and contrast the top-down network design method shown in Figure 1-1 w ...

  • 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

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

Describe what you learned about the impact of economic

Describe what you learned about the impact of economic, social, and demographic trends affecting the US labor environmen