<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-GB">
	<id>https://wiki.kram.nz/index.php?action=history&amp;feed=atom&amp;title=SE250%3Alab-X%3Agfun006</id>
	<title>SE250:lab-X:gfun006 - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.kram.nz/index.php?action=history&amp;feed=atom&amp;title=SE250%3Alab-X%3Agfun006"/>
	<link rel="alternate" type="text/html" href="https://wiki.kram.nz/index.php?title=SE250:lab-X:gfun006&amp;action=history"/>
	<updated>2026-04-28T16:10:22Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.45.3</generator>
	<entry>
		<id>https://wiki.kram.nz/index.php?title=SE250:lab-X:gfun006&amp;diff=8924&amp;oldid=prev</id>
		<title>Mark: 10 revision(s)</title>
		<link rel="alternate" type="text/html" href="https://wiki.kram.nz/index.php?title=SE250:lab-X:gfun006&amp;diff=8924&amp;oldid=prev"/>
		<updated>2008-11-03T05:20:44Z</updated>

		<summary type="html">&lt;p&gt;10 revision(s)&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==Task 1==&lt;br /&gt;
There are 9 possible spaces to put in &amp;quot;1 2 3 4 5 6 7 8 X&amp;quot; where X is the empty space. Thus in the first space there are 9 different possibilities, then 8, then 7 etc, ending up with 9 x 8 x 7 x 6 x 5 x 4 x 3 x 2 x 1 = 9! = 362880. The number of edges is I estimated was (4 x 8! + 3x4 x 8! + 2x4 x 8!)/2. That is a pure estimate, but I got that answer because I figured that when the state has a empty space in the middle, there are 4 different ways to move, when they are on the corners, there are 2 different ways and on the sides there are 3 different ways. There can only be one instance when the empty space is in the middle, 4 instances for the corner and 4 for the sides. Also, there is always the possibility of a state returning backwards, thus the answer is divided by 2.&lt;br /&gt;
&lt;br /&gt;
==Task 2==&lt;br /&gt;
STACK&lt;br /&gt;
&lt;br /&gt;
==Task 3==&lt;br /&gt;
                1 2 3&lt;br /&gt;
                4 5 6   &lt;br /&gt;
                  7 8&lt;br /&gt;
  &lt;br /&gt;
       1 2 3              1 2 3&lt;br /&gt;
         5 6              4 5 6&lt;br /&gt;
       4 7 8              7   8&lt;br /&gt;
 &lt;br /&gt;
 1 2 3        2 3   1 2 3       1 2 3&lt;br /&gt;
 5   6      1 5 6   4   6       4 5 6&lt;br /&gt;
 4 7 8      4 7 8   7 5 8       7 8&lt;br /&gt;
&lt;br /&gt;
There is always also the possibility of making a move back to the parent state every time. Spent a lot of time figuring out how cygwin works and then had to change the dot command again. It was not fun.&lt;br /&gt;
&lt;br /&gt;
==Task 4==&lt;br /&gt;
For some reason my search.c kept printing 10714 nodes. I don&amp;#039;t know why.&lt;br /&gt;
&lt;br /&gt;
Oh right, I&amp;#039;m an idiot and forgot to change the start and goal. I changed start to &amp;quot;123456.78&amp;quot; and goal to &amp;quot;12345678.&amp;quot;. This gave me the output of:&lt;br /&gt;
&amp;lt;HTML&amp;gt;&lt;br /&gt;
&amp;lt;PRE&amp;gt;&lt;br /&gt;
123&lt;br /&gt;
456&lt;br /&gt;
.78&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
123&lt;br /&gt;
456&lt;br /&gt;
7.8&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
123&lt;br /&gt;
456&lt;br /&gt;
78.&lt;br /&gt;
123&lt;br /&gt;
456&lt;br /&gt;
.78&lt;br /&gt;
 -&amp;gt;&lt;br /&gt;
123&lt;br /&gt;
456&lt;br /&gt;
7.8&lt;br /&gt;
 -&amp;gt;&lt;br /&gt;
123&lt;br /&gt;
456&lt;br /&gt;
78.&lt;br /&gt;
 -&amp;gt;&lt;br /&gt;
Visited 5 states&lt;br /&gt;
&amp;lt;/PRE&amp;gt;&lt;br /&gt;
&amp;lt;/HTML&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I put the print_state(&amp;amp;s) command after the pop_OrderedStateList( &amp;amp;open, &amp;amp;s ) command. The output seems to make sense...although I don&amp;#039;t understand why it visited 5 states. It seemed to only go through 3.&lt;/div&gt;</summary>
		<author><name>Mark</name></author>
	</entry>
</feed>