SE250:lab-X:vpup001
task1
well there are 9 squares so apparently there will 9! states.
To estimate the number of edges in the complete state space graph, we need to calculate the number of posible squares the "space" can go from every single square of 3x3 grid.
I had no idea how to calculate it. I got help from this guy in the lab.
- if the space is in the corners it has 2 posible choices and there are 4 corners.
- if it is in the middle it has 4 choices.
- if it is goes to left or up from the corner, it has 3 choices from that position and there are 4 square with 3 choices.
(4*2)+(4)+(4*3)=24
Then you divide that by 9 since there are 9 grids. 24/9=2.67 and since there 9! states, times the answer by 9! and since we have repeated the choice twice, we divide it by 2.
So, the answer is... 9!*2.67/2=483840.
There are 483840 edges in the complete stae space graph.
task 2
I am not sure what's going on here.
task 3
With the help of the tutor, I figured out how to draw the graph. I checked it with the file graph.c and it looks the same :)