Sunteți pe pagina 1din 31

Presented By: Saumya Mittal Sri Krishna Pal Vishal Agarwal Vikram Pratap Singh

Introduction Problem Introduction Motivation Project Objective Scope of the Project Literature Survey System Design and Methodology Application of Rubiks Cube Technical Feasibility Conclusion References

Rubiks Cube became a worldwide phenomenon in the early 1980s, puzzling young and old alike. Competitions arose in which people tried to solve the cube in the shortest time. The world champion of 1982 took 22.95 seconds in his best of three attempts.

Now the world record is 9.18 seconds for a single solve and 11.33 for an average of five solves.

The project deals with the aspect of better solving methods. Computer programs-implementing a fixed human method, others using general search algorithms already exist. In most cases the cube can be solved in 18 turns, and some programs are able to find even faster solutions. The fastest human solvers usually use around 50 to 60 turns.

In a classic Rubik's Cube, each of the six faces is covered by nine stickers, among six colors. A pivot mechanism enables each face independently, thus mixing up the colors. to turn

For the puzzle to be solved, each face must be a solid color.

The Rubik's Cube is a 3-D mechanical puzzle invented by a Hungarian sculptor and professor of architecture, Ern Rubik in 1974. The Rubiks cube proved its usefulness in medical world. Doctors frequently use the Rubiks cube on patients, and monitor the changes in the nervous system, as the patient spends time in the cube. It is widely considered to be the world's best-selling puzzle.

To enhance the capability of standard Iterative Deepening A*(IDA*) algorithm through the use of pattern database. To provide a generalised optimal solution for solving the Rubiks cube, given any initial state or position. 1) To solve the Rubiks cube in minimum number of steps. 2) To solve the Rubiks cube with minimum space complexity.

Identifying the shortcomings with the existing algorithmic solutions.

Survey and assess various algorithms and optimization techniques that can be applied.

Designing the system architecture in the light of IDA* algorithm.

Implementing the algorithm to solve the puzzle in the minimum possible time and using the less memory space.

Analysing the IDA* approach with a view to obtain the optimal solution.

Analyzing the result and comparing with the previous approaches. Implementing encryption and decryption using RUBIKS CUBE approach.

Study and analysis of researches that have been carried out regarding the implementation of Rubiks cube problem . Various algorithms that have been used previously are:
Gods

Algorithm (Herbert http://kociemba.org/cube.htm, 2006)

Kociemba.

Cube

Explorer.

Uninformed

searches (Herbert http://kociemba.org/cube.htm, 2006)


search (Herbert http://kociemba.org/cube.htm, 2006)

Kociemba.
Kociemba.

Cube
Cube

Explorer.
Explorer.

Informed

Uniform cost

(Alexander H. Frey, Jr. and David Singmaster. Handbook of Cubik Math. Enslow Publishers, 1982)
Cubik Math. Enslow Publishers, 1982.)

A* Algorithm (Alexander H. Frey, Jr. and David Singmaster. Handbook of

GODS ALGORITHM:

Uses a lookup table that is keyed over the various instances of the problem. Rather than giving the solution, it gives the minimum number of moves remaining to reach the goal state.

ADVANTAGES:

Through the lookup table the minimum number of moves can be identified.

DISADVANTAGE:

Gives the number of moves to reach the goal state instead of the actual solution.

UNINFORMED SEARCHES:

Extreme number of states is given. Searches such as BFS (breadth first search) or DFS (depth first search) can be used to get an optimal solution

ADVANTAGE: Can potentially find the solution quite quickly if it happens to select nodes that lead to the solution.
DISADVANTAGES:

BFS is a slow and methodical search. All the states must be kept in memory. Exceeds the memory limit of on any conventional computer.

INFORMED SEARCH:

Orders the nodes in the queue based on an estimate of the distance remaining to the goal state.
Helps in that the estimate never overestimates the distance remaining.

Increases the chances that the shortest path will be found.


ADVANTAGE: It chooses the next node to explore based on some greedy estimate of the distance remaining to the goal state. DISADVANTAGE: It is neither optimal nor complete.

UNIFORM COST ALGORITHM: Orders the elements in the queue by the distance from the initial state. ADVANTAGES: May produce an optimal solution. DISADVANTAGES: Based on the number moves from the initial state which makes this uniform cost equivalent to BFS. A* ALGORITHM: Combines the two best-first searches of uniform cost with the greedy search. Uses an admissible heuristic to produce an optimal search. DISADVANTAGES:

The memory complexity of this algorithm is O(bd ).

Simply A* with iterative deepening.

Reduces the memory complexity from O(b d ) to O(bd) .


Keeps track of the maximum depth explored from the last iteration and incrementally increases it.

No need to store all the states in memory.


Gives an optimal solution.

Problem with IDA*:


The search space size. Therefore, there is a need to optimize IDA*,by reducing the search

space.

First proposed by Culberson and Schaeffer. Key idea is to take a subset of the goals of the original problem. Pre-computing and storing the exact number of moves needed to solve these sub goals from all possible initial states. Exact solution to the sub goals is used as a lower bound heuristic for an IDA* search. To avoid the runtime computation of the heuristic, at the expense of the extra memory storage.

Translate the physical puzzle into a symbolic problem space to be manipulated by a computer. Six immovable cubes form a fixed reference framework, disallowing rotations of the entire cube.

Of the remaining 20 movable cubes, 8 are on the corners, and 12 are on the edges.
A corner cube in a given position can be oriented in three ways. An edge cube can be oriented in two different ways. Represented by an array of 20 elements, one for each cube.

IDA* search uses a lower-bound heuristic to prune branches once their estimated length exceeds the bound. The obvious heuristic is a three-dimensional version of the Manhattan distance. Unfortunately this value is not admissible. A better heuristic is required.

We use a heuristic computed by a table lookup. During the search as each state is generated, a unique index into the heuristic table is computed, followed by a reference to the table. The stored value is the number of moves needed to solve the corner cubes. This table only needs to be computed once for each goal state.

Table is generated in a breadth-first "forward-search" manner. Depth 0 is stored at the position of the goal state. If there are not many empty entries left in the pruning table, we flip to "backward search". We save a considerable amount of time when generating the tables.

ENCRYPTION AND DECRYPTION VIA RUBIKS CUBE


TO ENCRYPT THE MESSAGE:

The Rubiks cube has 6 faces, each face having 9 stickers. Thus there are 54 stickers in all. There are 26 lowercase alphabets and 26 uppercase alphabets. Each of the uppercase alphabet ,lowercase alphabet along with a special character is written on each sticker. An unsolved Rubiks cube is equivalent to a encrypted message.

TO DECRYPT THE MESSAGE:


The key (moves which we make is taken in reverse order) is applied to the encrypted Rubiks cube. The decrypted Rubiks cube shows the decrypted message.

Start
Initialize the cube

Initialize the pattern Databases

Expand the initial node

Decide the Search Limit

Receive the initial state from user

Start creating the Search Tree

Terminate search and stop


limit reached

Yes

Is goal reached?

No

Send next work

Stop

Repeat search until the limit is reached

Iterative Deepening A*:


Introduced by Richard Korf in 1985. Reduces the memory complexity from O(bd) to O(bd). Keeps track of the maximum depth explored from the last iteration and increases it. No need to store all the states in memory. Also gives an optimal solution.

Suppose the scrambled cube is:

UL BD LB UF FL FD UR RF DR BU LD BR BDL FRU BRD RFD BLU URB FUL FLD


"0" is used if the twist does not change "1" for a clockwise twist "2" for an anti-clockwise twist A coordinate or a tuple of several coordinates represent sets corresponding to

some subgroup H. We store the number of moves which are necessary to bring the cube back to the subgroup H. The goal state is always included in H. The number of moves stored in the pruning table is always a lower bound for the number of moves to bring the cube back to the goal state. This is essential to make the algorithm work.

Optimizing the size of Memory Table:


The actual number of moves is not stored. The value number of moves modulo 3 is stored. So, when a face turn is applied, the number of moves, can be reconstructed with the earlier value mod 3. From the initial state try which one of the 18 face turns decreases the number mod 3. Repeating this until we have reached the goal state and counting the number of moves needed to do so.
o Finally we get the solved cube as o UF UR UB UL DF DR DB DL FR FL BR BL UFR URB UBL ULF DRF DFL DLB

DBR

1. Although a lot of work has been done in order to achieve an optimal solution for the Rubiks cube, finding an optimal solution has been a difficult task. 2. After doing research on the Rubiks puzzle and its solutions using heuristics search, it is clear that along with speed, memory efficiency is the most important factor to be looked at. 3. IDA* fits the criteria of a search algorithm providing an optimal solution without larger space complexity. However in searching for the best heuristic to solve the cube, thus by incorporating the pattern database approach to achieve an optimized solution to the Rubiks cube in the shortest time.

SOLUTION OF RUBIKS CUBE VIA IDA* ALGORITHM OPTIMIZATION OF THE ALGORITHM IMPLEMENTING ENCRYPTION AND DECRYPTION ALGORITHM VIA RUBIKS CUBE

SOFTWARE REQIUREMENTS

HARDWARE REQUIREMENTS

Operating System- Windows 7 or Windows XP.

Intel II Processor , 400 MHz

Front End- Java Platform J2EE Server


Back End- Oracle 10g Design Platform- Eclipse or Maven

3 GB RAM
Graphics card upto 512 MB.

[1] Gene Cooperman, Larry Finkelstein, and Namita Sarawagi. Applications of Cayley graphs. In AAECC: Applied Algebra, Algebraic Algorithms and Error-Correcting Codes, International Conference, pages 367378. LNCS, Springer-Verlag, 1990. [2] Alexander H. Frey, Jr. and David Singmaster. Handbook of Cubik Math. Enslow Publishers, 1982. [3] Herbert Kociemba. Cube Explorer. http://kociemba.org/cube.htm, 2006. [4] Richard Korf. Finding optimal solutions to Rubiks cube using pattern databases. In Proceedings of the Workshop on Computer Games (W31) at IJCAI-97, pages 2126, Nagoya, Japan, 1997. [5] Silviu Radu. Rubik can be solved in 27f. http://cubezzz.homelinux.org/drupal/?q= node/view/53, 2006. [6] Michael Reid. New upper bounds. http://www.math.rwth-aachen.de/Martin. Schoenert/Cube-Lovers/michael_re%id__new_upper_bounds.html, 1995. [7] Michael Reid. Superflip requires 20 face turns. http://www.math.rwthaachen.de/Martin. Schoenert/Cube-Lovers/michael_re%id_ _superflip_requires_20_face_turns.html, 1995.

S-ar putea să vă placă și