0% found this document useful (0 votes)
16 views3 pages

FirstProgrammingAssignment

The document outlines the first programming assignment for the Artificial Intelligence course at FAST-NUCES, focusing on the Rubik's Cube and state space search. Students, in groups of up to three, are required to implement cube state representation, scramble the cube using specified moves, and compare search strategies (BFS, DFS, A*) to find the optimal solution. The assignment is due on 09/02/2025 and includes penalties for late submissions and plagiarism.

Uploaded by

Mohsin Khan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views3 pages

FirstProgrammingAssignment

The document outlines the first programming assignment for the Artificial Intelligence course at FAST-NUCES, focusing on the Rubik's Cube and state space search. Students, in groups of up to three, are required to implement cube state representation, scramble the cube using specified moves, and compare search strategies (BFS, DFS, A*) to find the optimal solution. The assignment is due on 09/02/2025 and includes penalties for late submissions and plagiarism.

Uploaded by

Mohsin Khan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Department of Computer Science FAST-NUCES Lahore Campus

Artificial Intelligence

Programming Assignment No 1 (Sections CS 6A, CS 6B)


Spring 2025
Assigned on 02/02/2025 Deadline 09/02/2025 11:59 p.m.
Submission: Online on GCR Weight 4%

Instructions:

Following rules will be enforced for this assignment

 Group of at most three students (Cross-Section group formation is allowed)


 You might be asked to explain you approach and implementation details during a
detailed evaluation.
 Late submission will be allowed only if prior permission is granted
Please remember that PLAGIARISM is INTOLERABLE and anyone found involved in it will
get -4 marks (i.e. 100% penalty) in this assignment.

State Space Search


The Rubik's Cube is an important test domain for heuristic search that has 1019 possible states, making
it impossible to store in memory and solving it using exhaustive search.

For this assignment we will use that convention that a single move on a Rubik's Cube can be defined as
a quarter turn (90') of any face either clockwise or anticlockwise. Therefore there are twelve possible
moves in each state of the cube.

Part a) [Implement the Basics] [20 Points]

In this part you are required to find and implement an efficient representation of the cube state and
implement the basic functions of applying a move in a given state to generate the next state. It might be
a good idea to package the state and the functions in a class.
Department of Computer Science FAST-NUCES Lahore Campus

Artificial Intelligence

Programming Assignment No 1 (Sections CS 6A, CS 6B)


Spring 2025
Assigned on 02/02/2025 Deadline 09/02/2025 11:59 p.m.
Submission: Online on GCR Weight 4%

Part b) [Create a problem] [20 Points]

Implement a function to scramble the state using a sequence of moves that are specified in a text file.
The text file will contain an initial state of the cube on a single line followed by the moves to be applied
on this state with each successive line containing a single move consisting of a faceID and moveID pair.
The faceID will have six distinct values {F: Front, T: Top, B: Bottom, L: Left, R: Right, A: bAck} and
moveID can have two values {C: Clockwise, A: Anti-clockwise}. Implement a function that generates a
new state NS from the initial state IS by successively applying the moves to the initial state. Finally
write the new state and the initial state in a new file on two separate lines.

Write a function that scrambles a given cube state based on a sequence of moves specified in a text file.
The text file will contain the initial cube state on a single line followed by a series of moves. Each move
consists of a faceID and a moveID pair, where faceID represents one of six faces ({F: Front, T: Top, B:
Bottom, L: Left, R: Right, A: Back}) and moveID indicates the rotation direction ({C: Clockwise, A: Anti-
clockwise}). The function should iteratively apply these moves to transform the initial state into a new
state. Finally, both the resulting final and the initial states should be written to a new file creating the
problem for state-space-search algorithms.

Part c) [Solve the problem] [60 Points]

Compare the performance of three search strategies including BFS, DFS/Iterative deepening and A*
search to determine a sequence of moves that will transform the initial state into the final state using
minimum number of moves (i.e. 90' turns of faces)

Your code for this part will use the problem generated in part b (the text file containing the two states)
to search for a solution that will transform the first state into the second.

The comparison of the three search strategies must include i) the number of states expanded and ii) the
size of the queue at every instance in time while solving the problem. For the A* search strategy you
must research a good heuristic function that can guide the search effectively. You must solve multiple
problems of varying complexity to make the comparison.
Department of Computer Science FAST-NUCES Lahore Campus

Artificial Intelligence

Programming Assignment No 1 (Sections CS 6A, CS 6B)


Spring 2025
Assigned on 02/02/2025 Deadline 09/02/2025 11:59 p.m.
Submission: Online on GCR Weight 4%

Submission.
1. A folder/directory containing your code Use your University ID to name the folder
[10 Points]
2. A detailed report documenting your implementation and results obtained
[40 Points]

You might also like