<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Message-Passing in my Puzzle-Solving Architecture</title>
	<atom:link href="http://www.somethinkodd.com/oddthinking/2008/01/04/message-passing-in-my-puzzle-solving-architecture/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.somethinkodd.com/oddthinking/2008/01/04/message-passing-in-my-puzzle-solving-architecture/</link>
	<description>A blog for odd things and odd thoughts.</description>
	<lastBuildDate>Wed, 01 Feb 2012 22:21:16 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: OddThinking &#187; Happy Third Anniversary, OddThinking!</title>
		<link>http://www.somethinkodd.com/oddthinking/2008/01/04/message-passing-in-my-puzzle-solving-architecture/comment-page-1/#comment-107846</link>
		<dc:creator>OddThinking &#187; Happy Third Anniversary, OddThinking!</dc:creator>
		<pubDate>Thu, 10 Apr 2008 14:31:11 +0000</pubDate>
		<guid isPermaLink="false">http://www.somethinkodd.com/oddthinking/2008/01/04/message-passing-in-my-puzzle-solving-architecture/#comment-107846</guid>
		<description>[...] puzzle-solving month, introducing Alphametics, and Slitherlinks, and discussing the generic architecture that can solve [...]</description>
		<content:encoded><![CDATA[<p>[...] puzzle-solving month, introducing Alphametics, and Slitherlinks, and discussing the generic architecture that can solve [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: OddThinking</title>
		<link>http://www.somethinkodd.com/oddthinking/2008/01/04/message-passing-in-my-puzzle-solving-architecture/comment-page-1/#comment-87978</link>
		<dc:creator>OddThinking</dc:creator>
		<pubDate>Sat, 19 Jan 2008 11:33:41 +0000</pubDate>
		<guid isPermaLink="false">http://www.somethinkodd.com/oddthinking/2008/01/04/message-passing-in-my-puzzle-solving-architecture/#comment-87978</guid>
		<description>[...] have (largely) implemented Aristotle&#8217;s suggestion to have the objects redraw themselves on demand without a need for a central authority. (Still some [...]</description>
		<content:encoded><![CDATA[<p>[...] have (largely) implemented Aristotle&#8217;s suggestion to have the objects redraw themselves on demand without a need for a central authority. (Still some [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Aristotle Pagaltzis</title>
		<link>http://www.somethinkodd.com/oddthinking/2008/01/04/message-passing-in-my-puzzle-solving-architecture/comment-page-1/#comment-86873</link>
		<dc:creator>Aristotle Pagaltzis</dc:creator>
		<pubDate>Sun, 13 Jan 2008 08:52:53 +0000</pubDate>
		<guid isPermaLink="false">http://www.somethinkodd.com/oddthinking/2008/01/04/message-passing-in-my-puzzle-solving-architecture/#comment-86873</guid>
		<description>Right, but the scales don’t quite compare – a puzzle solver vs. a medical expert system? I think the latter has a whole raft of additional concerns and then some – after all, it’s not an end unto itself. That might be an invalid argument if approaches to human-likeness developed in the context of the puzzle solver were applicable to a medical expert system, but that seem like more than a stretch to me.

What’s more, you skipped the part where I argued that the problem you were seeing is caused by giving each agent unbounded processing time and letting it decide when and which neighbours to yield any to. With that approach there’s no way to prevent the solution progression from degenerating into a series of local recursive deep dives. If instead you iterate over the entire board on each heartbeat, bounding the progress that each agent can make in a single cycle, then you get a steady solution progression across all the board, with all effects of any single event spreading in a uniform temporal progression, as opposed to being dependent on when an affected agent happens to be granted processing time by a neighbour.

(However, I see now that this post was written in the context of a puzzle &lt;em&gt;helper&lt;/em&gt;, rather than a puzzle &lt;em&gt;solver&lt;/em&gt;, which rather affects the concerns. Of course, when developing a &lt;em&gt;helper&lt;/em&gt;, you want something that will behave not unlike a human, so that it and the user can coöperate more effectively. Just like in the case of the medical expert system, human-likeness is (essentially) a usability concern.)</description>
		<content:encoded><![CDATA[<p>Right, but the scales don’t quite compare – a puzzle solver vs. a medical expert system? I think the latter has a whole raft of additional concerns and then some – after all, it’s not an end unto itself. That might be an invalid argument if approaches to human-likeness developed in the context of the puzzle solver were applicable to a medical expert system, but that seem like more than a stretch to me.</p>
<p>What’s more, you skipped the part where I argued that the problem you were seeing is caused by giving each agent unbounded processing time and letting it decide when and which neighbours to yield any to. With that approach there’s no way to prevent the solution progression from degenerating into a series of local recursive deep dives. If instead you iterate over the entire board on each heartbeat, bounding the progress that each agent can make in a single cycle, then you get a steady solution progression across all the board, with all effects of any single event spreading in a uniform temporal progression, as opposed to being dependent on when an affected agent happens to be granted processing time by a neighbour.</p>
<p>(However, I see now that this post was written in the context of a puzzle <em>helper</em>, rather than a puzzle <em>solver</em>, which rather affects the concerns. Of course, when developing a <em>helper</em>, you want something that will behave not unlike a human, so that it and the user can coöperate more effectively. Just like in the case of the medical expert system, human-likeness is (essentially) a usability concern.)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Julian</title>
		<link>http://www.somethinkodd.com/oddthinking/2008/01/04/message-passing-in-my-puzzle-solving-architecture/comment-page-1/#comment-86810</link>
		<dc:creator>Julian</dc:creator>
		<pubDate>Sat, 12 Jan 2008 22:04:46 +0000</pubDate>
		<guid isPermaLink="false">http://www.somethinkodd.com/oddthinking/2008/01/04/message-passing-in-my-puzzle-solving-architecture/#comment-86810</guid>
		<description>Aristotle,

&lt;blockquote&gt;Artificially making the solution path more human-like is an uninteresting problem.

If the human likeness was natural, ie. a second-order effect arising from the fact that the underlying solver works the same way as human cognition, that would be interesting&lt;/blockquote&gt;

I had trouble with these statements, but I couldn&#039;t place it.

The second statement I absolutely agree with. That&#039;s the territory Hofstadter explores.

But I couldn&#039;t simply dismiss &quot;artificially human-like&quot; as an uninteresting problem.

Today, I came up with a counter-example!

&lt;a href=&quot;http://en.wikipedia.org/wiki/Mycin&quot; rel=&quot;nofollow&quot;&gt;Mycin&lt;/a&gt; was an Artificial Intelligence experiment from the 1970s. It was a rule-based expert system (in the domain of blood-bourne bacteria). It would fire off simple questions to the doctor about the patients signs and symptoms, and develop an idea of the most likely diagnosis and best treatment. The questions asked would depend on the previous answers.

Unlike a human, the software didn&#039;t work by picking one bacteria species (or group of bacteria) and then testing to confirm or eliminate their conjecture. It was working on calculating the likelihood of every possible bacteria at once.

However, the developers found that if Mycin&#039;s questions jumped around too much (tell me about Blood Test A, tell me about Blood Test B, tell me more about Blood Test A), it confused or worried the users. They made it seem more natural by changing the question order to look like it was following up a hypothesis, perhaps abandoning it based on the evidence and trying another hypothesis.

So, here was a case where they made no attempt to emulate human cognition at the lower-levels (it was still a rules-based engine, not a neural net or the like) but they made it &quot;artificially human-like&quot; in order to improve usability.

I clearly think it is an interesting case, because I still remember it well over a decade-and-a-half after hearing about it. (On the other hand, don&#039;t trust my description of the project too closely for the same reason!)</description>
		<content:encoded><![CDATA[<p>Aristotle,</p>
<blockquote><p>Artificially making the solution path more human-like is an uninteresting problem.</p>
<p>If the human likeness was natural, ie. a second-order effect arising from the fact that the underlying solver works the same way as human cognition, that would be interesting</p></blockquote>
<p>I had trouble with these statements, but I couldn&#8217;t place it.</p>
<p>The second statement I absolutely agree with. That&#8217;s the territory Hofstadter explores.</p>
<p>But I couldn&#8217;t simply dismiss &#8220;artificially human-like&#8221; as an uninteresting problem.</p>
<p>Today, I came up with a counter-example!</p>
<p><a href="http://en.wikipedia.org/wiki/Mycin" rel="nofollow" class="wikipedia">Mycin</a> was an Artificial Intelligence experiment from the 1970s. It was a rule-based expert system (in the domain of blood-bourne bacteria). It would fire off simple questions to the doctor about the patients signs and symptoms, and develop an idea of the most likely diagnosis and best treatment. The questions asked would depend on the previous answers.</p>
<p>Unlike a human, the software didn&#8217;t work by picking one bacteria species (or group of bacteria) and then testing to confirm or eliminate their conjecture. It was working on calculating the likelihood of every possible bacteria at once.</p>
<p>However, the developers found that if Mycin&#8217;s questions jumped around too much (tell me about Blood Test A, tell me about Blood Test B, tell me more about Blood Test A), it confused or worried the users. They made it seem more natural by changing the question order to look like it was following up a hypothesis, perhaps abandoning it based on the evidence and trying another hypothesis.</p>
<p>So, here was a case where they made no attempt to emulate human cognition at the lower-levels (it was still a rules-based engine, not a neural net or the like) but they made it &#8220;artificially human-like&#8221; in order to improve usability.</p>
<p>I clearly think it is an interesting case, because I still remember it well over a decade-and-a-half after hearing about it. (On the other hand, don&#8217;t trust my description of the project too closely for the same reason!)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: OddThinking &#187; Solving Slitherlinks with Software</title>
		<link>http://www.somethinkodd.com/oddthinking/2008/01/04/message-passing-in-my-puzzle-solving-architecture/comment-page-1/#comment-86748</link>
		<dc:creator>OddThinking &#187; Solving Slitherlinks with Software</dc:creator>
		<pubDate>Sat, 12 Jan 2008 13:36:45 +0000</pubDate>
		<guid isPermaLink="false">http://www.somethinkodd.com/oddthinking/2008/01/04/message-passing-in-my-puzzle-solving-architecture/#comment-86748</guid>
		<description>[...] architecture I used was my old stand-by, that I have used in many puzzle projects before [...]</description>
		<content:encoded><![CDATA[<p>[...] architecture I used was my old stand-by, that I have used in many puzzle projects before [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Julian</title>
		<link>http://www.somethinkodd.com/oddthinking/2008/01/04/message-passing-in-my-puzzle-solving-architecture/comment-page-1/#comment-86485</link>
		<dc:creator>Julian</dc:creator>
		<pubDate>Fri, 11 Jan 2008 10:31:22 +0000</pubDate>
		<guid isPermaLink="false">http://www.somethinkodd.com/oddthinking/2008/01/04/message-passing-in-my-puzzle-solving-architecture/#comment-86485</guid>
		<description>Alastair,

&lt;blockquote&gt;This would seem to be a key goal for the software design and you seem to have moved towards a design which enabled this, and yet it does not feature explicitly in your descriptions above.&lt;/blockquote&gt;

This is interesting; I think you have leapt further upwards with your thinking than I have. 

You are suggesting that flexibility is a key goal. I am not sure I have been deliberately coding towards flexibility. I have just been coding towards what I thought was a better design. As I did, the inflexible pieces kept breaking off, and being replaced with more flexible components. There&#039;s a difference there, I think. I didn&#039;t start with the idea of a framework; but I re-used ideas often enough, it started to appear.

That&#039;s probably why I didn&#039;t mention it; I didn&#039;t realise it was important.

&lt;blockquote&gt;there are two sets of rules that you wish to model: the rules of the puzzle itself and the rules of the puzzle solving algorithm.&lt;/blockquote&gt;

I pondered that for a bit - where had I encoded the rules of the puzzle? I now see four parts to the code:

&lt;ul&gt;&lt;li&gt;The general puzzle-independent code that drives the algorithm, such as this message-passing stuff.&lt;/li&gt;
&lt;li&gt;The logic code (the rules of the puzzle-solving algorithm) that says &quot;This is Sudoku and there is a 4 in this row, you can&#039;t be a four.&quot; or &quot;This is Solitaire Battleships, and there is a ship north-east of you, so you can&#039;t be a ship.&quot;&lt;/li&gt;
&lt;li&gt;There is the game-board initialisation code which says &quot;This is Solitaire Battleships, so initialise the game with 64 cells, and link up the neighbourhood links like an 8x8 square grid.&quot; or &quot;This is Virus 2, so initialise the game with 320 cells, and link up the neighbourhood like a 16x20 hex grid.&quot; These are part of the rules of the game, but only the static part - what the board looks like at the beginning.&lt;/li&gt;
&lt;li&gt;Finally, there is the actual rules of the game. &quot;Solitaire Battleships: you can&#039;t have two different ships touching.&quot;, &quot;Sudoku: You can&#039;t have two identical numbers in a single row.&quot; My initial thought was &quot;Hey, this is weird, but I never actually code those rules.&quot; Later, I realised I &lt;em&gt;did&lt;/em&gt; code those rules, but only in &lt;code&gt;assert&lt;/code&gt; statements!&lt;/li&gt;
&lt;/ul&gt;</description>
		<content:encoded><![CDATA[<p>Alastair,</p>
<blockquote><p>This would seem to be a key goal for the software design and you seem to have moved towards a design which enabled this, and yet it does not feature explicitly in your descriptions above.</p></blockquote>
<p>This is interesting; I think you have leapt further upwards with your thinking than I have. </p>
<p>You are suggesting that flexibility is a key goal. I am not sure I have been deliberately coding towards flexibility. I have just been coding towards what I thought was a better design. As I did, the inflexible pieces kept breaking off, and being replaced with more flexible components. There&#8217;s a difference there, I think. I didn&#8217;t start with the idea of a framework; but I re-used ideas often enough, it started to appear.</p>
<p>That&#8217;s probably why I didn&#8217;t mention it; I didn&#8217;t realise it was important.</p>
<blockquote><p>there are two sets of rules that you wish to model: the rules of the puzzle itself and the rules of the puzzle solving algorithm.</p></blockquote>
<p>I pondered that for a bit &#8211; where had I encoded the rules of the puzzle? I now see four parts to the code:</p>
<ul>
<li>The general puzzle-independent code that drives the algorithm, such as this message-passing stuff.</li>
<li>The logic code (the rules of the puzzle-solving algorithm) that says &#8220;This is Sudoku and there is a 4 in this row, you can&#8217;t be a four.&#8221; or &#8220;This is Solitaire Battleships, and there is a ship north-east of you, so you can&#8217;t be a ship.&#8221;</li>
<li>There is the game-board initialisation code which says &#8220;This is Solitaire Battleships, so initialise the game with 64 cells, and link up the neighbourhood links like an 8&#215;8 square grid.&#8221; or &#8220;This is Virus 2, so initialise the game with 320 cells, and link up the neighbourhood like a 16&#215;20 hex grid.&#8221; These are part of the rules of the game, but only the static part &#8211; what the board looks like at the beginning.</li>
<li>Finally, there is the actual rules of the game. &#8220;Solitaire Battleships: you can&#8217;t have two different ships touching.&#8221;, &#8220;Sudoku: You can&#8217;t have two identical numbers in a single row.&#8221; My initial thought was &#8220;Hey, this is weird, but I never actually code those rules.&#8221; Later, I realised I <em>did</em> code those rules, but only in <code>assert</code> statements!</li>
</ul>
]]></content:encoded>
	</item>
	<item>
		<title>By: Julian</title>
		<link>http://www.somethinkodd.com/oddthinking/2008/01/04/message-passing-in-my-puzzle-solving-architecture/comment-page-1/#comment-86484</link>
		<dc:creator>Julian</dc:creator>
		<pubDate>Fri, 11 Jan 2008 10:29:26 +0000</pubDate>
		<guid isPermaLink="false">http://www.somethinkodd.com/oddthinking/2008/01/04/message-passing-in-my-puzzle-solving-architecture/#comment-86484</guid>
		<description>Aristotle, 

&lt;blockquote&gt;I haven’t come across a cellular automaton that didn’t have a global clock cycle. If you did that, you’d introduce a bias into your simulated universe whereby messages in certain directions travel into the future.&lt;/blockquote&gt;

That wasn&#039;t quite what I was thinking. Imagine a global clock, but with real (i.e. floating-point, not integer) time.

Imagine cells with floating-point energy levels (hit points?), that are drained or charged by the presence of neighbours which may appear and disappear at any time. Cells might be born with the average of the initial hit-points of their parents, so they are spread out over the real number.

You could even write the rules to have it degenerate to a standard  (well-known) cellular automata if the initial conditions happen to be that all the cells start with integer values.

I need to emphasize that I don&#039;t have much experience with cellular automata, so I imagine I am reinventing the wheel here. It&#039;s probably been done before.</description>
		<content:encoded><![CDATA[<p>Aristotle, </p>
<blockquote><p>I haven’t come across a cellular automaton that didn’t have a global clock cycle. If you did that, you’d introduce a bias into your simulated universe whereby messages in certain directions travel into the future.</p></blockquote>
<p>That wasn&#8217;t quite what I was thinking. Imagine a global clock, but with real (i.e. floating-point, not integer) time.</p>
<p>Imagine cells with floating-point energy levels (hit points?), that are drained or charged by the presence of neighbours which may appear and disappear at any time. Cells might be born with the average of the initial hit-points of their parents, so they are spread out over the real number.</p>
<p>You could even write the rules to have it degenerate to a standard  (well-known) cellular automata if the initial conditions happen to be that all the cells start with integer values.</p>
<p>I need to emphasize that I don&#8217;t have much experience with cellular automata, so I imagine I am reinventing the wheel here. It&#8217;s probably been done before.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alastair</title>
		<link>http://www.somethinkodd.com/oddthinking/2008/01/04/message-passing-in-my-puzzle-solving-architecture/comment-page-1/#comment-85676</link>
		<dc:creator>Alastair</dc:creator>
		<pubDate>Fri, 04 Jan 2008 21:45:31 +0000</pubDate>
		<guid isPermaLink="false">http://www.somethinkodd.com/oddthinking/2008/01/04/message-passing-in-my-puzzle-solving-architecture/#comment-85676</guid>
		<description>Excellent article and discussion.

I have noticed that in more recent puzzle solving attempts you have played around with different approaches (eg the recent Virus puzzle). This would seem to be a key goal for the software design and you seem to have moved towards a design which enabled this, and yet it does not feature explicitly in your descriptions above.

In other words, there are two sets of rules that you wish to model: the rules of the puzzle itself and the rules of the puzzle solving algorithm. The former is fixed, and the latter needs to vary. The ease by which this can happen is a key success measure of the overall design.

(In some ways this conflicts with your everything-is-decentralised aesthetic, although it&#039;s probably a matter of opinion.)

Anyway: It seems to me that your initial &quot;simple&quot; solutions such as recursion do not succeed in separating puzzle rules from the solution algorithm, and so can be considered undesirable for this reason (as well as the others). On the other hand, the prioritised command set approach does seem to allow this, as the subsequent discussion has revealed.

Thanks also for the pointer to Hofstadter - I haven&#039;t picked it up in years but will do so now.</description>
		<content:encoded><![CDATA[<p>Excellent article and discussion.</p>
<p>I have noticed that in more recent puzzle solving attempts you have played around with different approaches (eg the recent Virus puzzle). This would seem to be a key goal for the software design and you seem to have moved towards a design which enabled this, and yet it does not feature explicitly in your descriptions above.</p>
<p>In other words, there are two sets of rules that you wish to model: the rules of the puzzle itself and the rules of the puzzle solving algorithm. The former is fixed, and the latter needs to vary. The ease by which this can happen is a key success measure of the overall design.</p>
<p>(In some ways this conflicts with your everything-is-decentralised aesthetic, although it&#8217;s probably a matter of opinion.)</p>
<p>Anyway: It seems to me that your initial &#8220;simple&#8221; solutions such as recursion do not succeed in separating puzzle rules from the solution algorithm, and so can be considered undesirable for this reason (as well as the others). On the other hand, the prioritised command set approach does seem to allow this, as the subsequent discussion has revealed.</p>
<p>Thanks also for the pointer to Hofstadter &#8211; I haven&#8217;t picked it up in years but will do so now.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Aristotle Pagaltzis</title>
		<link>http://www.somethinkodd.com/oddthinking/2008/01/04/message-passing-in-my-puzzle-solving-architecture/comment-page-1/#comment-85642</link>
		<dc:creator>Aristotle Pagaltzis</dc:creator>
		<pubDate>Fri, 04 Jan 2008 11:30:34 +0000</pubDate>
		<guid isPermaLink="false">http://www.somethinkodd.com/oddthinking/2008/01/04/message-passing-in-my-puzzle-solving-architecture/#comment-85642</guid>
		<description>I haven’t come across a cellular automaton that didn’t have a global clock cycle. If you did that, you’d introduce a bias into your simulated universe whereby messages in certain directions travel into the future. If you have a simple 2D grid, say, and you iterate from left to right (and top to bottom), then state changes will have a rightward effect within the current cycle while they can only have a leftward effect on the next cycle. So the order in which you ping elements affects the outcome. You need the past/future segregation of propagating state changes to remove this bias.

Of course such bias is not a problem in your case – it only affects the path taken towards the solution, not the final outcome. But I still dislike it on principle. There are other instances of similar phenomena, eg. simpleminded iterative substitution template engines, where it’s undesirable for modifications from the last and current iterations to mix. (Iterative substitution, of course, is naught but a very special case of a cellular automaton…)

I guess in mind, once you cast a problem as a collection of actors, it is more like universe governed by a set of laws to which the constituents are subject. It doesn’t have the same “feel” anymore as a search algorithm, which it would be if you cast it that way.

&lt;blockquote&gt;Another possibility that I did not implement was to try to make the order of the processing seem “more natural” to a human observing the animation.&lt;/blockquote&gt;

I think this too is an artifact of your approach, and likewise is your realisation that you should let each agent update its display whenever it changed state. I think iterating over the entire board to redraw it at once is just fine, and artificially making the solution path more human-like is an uninteresting problem.

If the human likeness was natural, ie. a second-order effect arising from the fact that the underlying solver works the same way as human cognition, that would be interesting – but that is rather a large problem to tackle, and one I doubt is either in the scope of your interest or your reach. (Otherwise, I’m sure there are a few neuroscientists who’d like to talk to you…)

If you have a global heartbeat as I outlined, the solver algorithm won’t go on a recursive deep dive in one spot before it randomly resurfaces and wanders over to somewhere else. It would be quite natural to redraw the entire board once at the end of one main loop iteration, too. The solution finding would then proceed apace across the entire board, so “is anything happening?” phases are much less likely. What’s more, state changes that fix a value which happens to be a strong constraint in the particular problem at hand would cause a ripple effect that you could actually see. With an unconstrained depth-first recursion approach, the processing order is biased so that some agents affected by a state change will not be visited until long after it happened, concealing such ripple effects in many problem configurations.</description>
		<content:encoded><![CDATA[<p>I haven’t come across a cellular automaton that didn’t have a global clock cycle. If you did that, you’d introduce a bias into your simulated universe whereby messages in certain directions travel into the future. If you have a simple 2D grid, say, and you iterate from left to right (and top to bottom), then state changes will have a rightward effect within the current cycle while they can only have a leftward effect on the next cycle. So the order in which you ping elements affects the outcome. You need the past/future segregation of propagating state changes to remove this bias.</p>
<p>Of course such bias is not a problem in your case – it only affects the path taken towards the solution, not the final outcome. But I still dislike it on principle. There are other instances of similar phenomena, eg. simpleminded iterative substitution template engines, where it’s undesirable for modifications from the last and current iterations to mix. (Iterative substitution, of course, is naught but a very special case of a cellular automaton…)</p>
<p>I guess in mind, once you cast a problem as a collection of actors, it is more like universe governed by a set of laws to which the constituents are subject. It doesn’t have the same “feel” anymore as a search algorithm, which it would be if you cast it that way.</p>
<blockquote><p>Another possibility that I did not implement was to try to make the order of the processing seem “more natural” to a human observing the animation.</p></blockquote>
<p>I think this too is an artifact of your approach, and likewise is your realisation that you should let each agent update its display whenever it changed state. I think iterating over the entire board to redraw it at once is just fine, and artificially making the solution path more human-like is an uninteresting problem.</p>
<p>If the human likeness was natural, ie. a second-order effect arising from the fact that the underlying solver works the same way as human cognition, that would be interesting – but that is rather a large problem to tackle, and one I doubt is either in the scope of your interest or your reach. (Otherwise, I’m sure there are a few neuroscientists who’d like to talk to you…)</p>
<p>If you have a global heartbeat as I outlined, the solver algorithm won’t go on a recursive deep dive in one spot before it randomly resurfaces and wanders over to somewhere else. It would be quite natural to redraw the entire board once at the end of one main loop iteration, too. The solution finding would then proceed apace across the entire board, so “is anything happening?” phases are much less likely. What’s more, state changes that fix a value which happens to be a strong constraint in the particular problem at hand would cause a ripple effect that you could actually see. With an unconstrained depth-first recursion approach, the processing order is biased so that some agents affected by a state change will not be visited until long after it happened, concealing such ripple effects in many problem configurations.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Julian</title>
		<link>http://www.somethinkodd.com/oddthinking/2008/01/04/message-passing-in-my-puzzle-solving-architecture/comment-page-1/#comment-85608</link>
		<dc:creator>Julian</dc:creator>
		<pubDate>Fri, 04 Jan 2008 06:53:50 +0000</pubDate>
		<guid isPermaLink="false">http://www.somethinkodd.com/oddthinking/2008/01/04/message-passing-in-my-puzzle-solving-architecture/#comment-85608</guid>
		<description>Aristotle,

Some interesting thoughts, thank you.

Let me start at the sentence that struck me first:

&lt;blockquote&gt;The fact that you update the accompanying graphics at more or less arbitrary points is an obvious symptom.&lt;/blockquote&gt;

OMG! You are right! I render the graphics by iterating through each of the items and asking them to render themselves onto a static image object. When they are complete, I display the image object. Each of the items has a &quot;dirty bit&quot; to indicate whether they have been updated since the last rendering. If not, they can skip re-rendering.

I immediately realised, after reading your comment, I should have rather simply had the object re-render itself immediately that it realises it is dirty. If that is too frequent, the object should at least register itself with some &quot;sweep&quot; mechanism as being dirty, rather than being polled. The more I can make the overriding manager object (generally called the &quot;Grid&quot; object in most of the projects) merely a collection of autonomous objects and not something that understands the rules of the game, the happier I would be.

I pondered for a minute why that wasn&#039;t the original architecture. I realised it was an artifact of how the rendering system came about. 

I originally just took a snapshot of the board state and created a (Python Imagine Library) image. I stored it to a file or displayed it as a static item on the screen. Every object needed to be rendered at the same time. Later, I learnt just enough of PyGame to display a series of static images on the screen and receive mouse-presses back, to do simple animation of the algorithm.

I obviously never bothered to learn to go fully native with PyGame and have parts of the screen update asynchronously, without consideration of the rest of the board. It is now on my To Do list. Thank you.

&lt;blockquote&gt;Elements that have arrived at their final value unregister themselves from the main loop so they won’t get pinged again.&lt;/blockquote&gt;

I know at least one of the projects (Kakuro?) went some way down that path. Cells that considered themselves &quot;solved&quot; deregistered themselves from their neighbours lists. 

Most of the projects have eschewed this sophistication and have simply had &lt;code&gt;if (solved) return;&lt;/code&gt; at the top of their notification routines. (Both the methods that add the commands to the command queue, and the methods that are called when a command is popped from the queue.)

&lt;blockquote&gt;That gives you a very clear arrow of time, a speed of light by which information travels across the board&lt;/blockquote&gt;

I certainly understand this motivation to have the solution proceed in a logical fashion.

When writing the &lt;a href=&quot;http://www.somethinkodd.com/oddthinking/2005/06/12/the-no-nos-and-yes-yeses-of-the-nonogram-solution/&quot; rel=&quot;nofollow&quot;&gt;detail of the Nonogram implementation&lt;/a&gt;, I wrote:

&lt;blockquote&gt;Another possibility that I did not implement was to try to make the order of the processing seem “more natural” to a human observing the animation. By focussing the processing on, for example the top-left corner, before processing equivalent commands on the bottom-right, I thought it might make the puzzles solution tend to appear as a gradual, yet intermittent (perhaps the right word is “punctuated”?) wipe rather than the whole puzzle being gradually being brought into focus with a series of quick waves.&lt;/blockquote&gt;

I considered (briefly) how you could determine an &quot;area of interest&quot; for a human. Your solution (as with mine) would have ripples of change that radiate out from a clue. I think a human would tend not to work that way, but instead follow more linearly along one seam of information, possible (but not definitely - with a probability reducing over time) returning the to centre once the seam was mined. Occasionally, if there was little progress in one area, they might jump randomly to another area out of boredom. (Actually quitting the puzzle in frustration and going to read the newspaper instead wasn&#039;t the behaviour I was thinking of modelling!)

I mentioned Hofstadter&#039;s book in the above article. That work was focussed on modelling the human approach to problem solving, rather than solving it in the fastest time.

To conclude, I see the ordering of the solution as an interesting area, and I certainly think your approach has merits. However, I don&#039;t perceive my approach as being any less elegant (graphics rendering aside).

My breadth of experience with cellular automata is narrow - only Conway&#039;s Game of Life - but I hope there are some out there that don&#039;t use Conway&#039;s firm drum-beat of generations, and instead have them procreate more evenly over time. That would be more like the way my code has been solving these problems.</description>
		<content:encoded><![CDATA[<p>Aristotle,</p>
<p>Some interesting thoughts, thank you.</p>
<p>Let me start at the sentence that struck me first:</p>
<blockquote><p>The fact that you update the accompanying graphics at more or less arbitrary points is an obvious symptom.</p></blockquote>
<p>OMG! You are right! I render the graphics by iterating through each of the items and asking them to render themselves onto a static image object. When they are complete, I display the image object. Each of the items has a &#8220;dirty bit&#8221; to indicate whether they have been updated since the last rendering. If not, they can skip re-rendering.</p>
<p>I immediately realised, after reading your comment, I should have rather simply had the object re-render itself immediately that it realises it is dirty. If that is too frequent, the object should at least register itself with some &#8220;sweep&#8221; mechanism as being dirty, rather than being polled. The more I can make the overriding manager object (generally called the &#8220;Grid&#8221; object in most of the projects) merely a collection of autonomous objects and not something that understands the rules of the game, the happier I would be.</p>
<p>I pondered for a minute why that wasn&#8217;t the original architecture. I realised it was an artifact of how the rendering system came about. </p>
<p>I originally just took a snapshot of the board state and created a (Python Imagine Library) image. I stored it to a file or displayed it as a static item on the screen. Every object needed to be rendered at the same time. Later, I learnt just enough of PyGame to display a series of static images on the screen and receive mouse-presses back, to do simple animation of the algorithm.</p>
<p>I obviously never bothered to learn to go fully native with PyGame and have parts of the screen update asynchronously, without consideration of the rest of the board. It is now on my To Do list. Thank you.</p>
<blockquote><p>Elements that have arrived at their final value unregister themselves from the main loop so they won’t get pinged again.</p></blockquote>
<p>I know at least one of the projects (Kakuro?) went some way down that path. Cells that considered themselves &#8220;solved&#8221; deregistered themselves from their neighbours lists. </p>
<p>Most of the projects have eschewed this sophistication and have simply had <code>if (solved) return;</code> at the top of their notification routines. (Both the methods that add the commands to the command queue, and the methods that are called when a command is popped from the queue.)</p>
<blockquote><p>That gives you a very clear arrow of time, a speed of light by which information travels across the board</p></blockquote>
<p>I certainly understand this motivation to have the solution proceed in a logical fashion.</p>
<p>When writing the <a href="http://www.somethinkodd.com/oddthinking/2005/06/12/the-no-nos-and-yes-yeses-of-the-nonogram-solution/" rel="nofollow" class="liinternal">detail of the Nonogram implementation</a>, I wrote:</p>
<blockquote><p>Another possibility that I did not implement was to try to make the order of the processing seem “more natural” to a human observing the animation. By focussing the processing on, for example the top-left corner, before processing equivalent commands on the bottom-right, I thought it might make the puzzles solution tend to appear as a gradual, yet intermittent (perhaps the right word is “punctuated”?) wipe rather than the whole puzzle being gradually being brought into focus with a series of quick waves.</p></blockquote>
<p>I considered (briefly) how you could determine an &#8220;area of interest&#8221; for a human. Your solution (as with mine) would have ripples of change that radiate out from a clue. I think a human would tend not to work that way, but instead follow more linearly along one seam of information, possible (but not definitely &#8211; with a probability reducing over time) returning the to centre once the seam was mined. Occasionally, if there was little progress in one area, they might jump randomly to another area out of boredom. (Actually quitting the puzzle in frustration and going to read the newspaper instead wasn&#8217;t the behaviour I was thinking of modelling!)</p>
<p>I mentioned Hofstadter&#8217;s book in the above article. That work was focussed on modelling the human approach to problem solving, rather than solving it in the fastest time.</p>
<p>To conclude, I see the ordering of the solution as an interesting area, and I certainly think your approach has merits. However, I don&#8217;t perceive my approach as being any less elegant (graphics rendering aside).</p>
<p>My breadth of experience with cellular automata is narrow &#8211; only Conway&#8217;s Game of Life &#8211; but I hope there are some out there that don&#8217;t use Conway&#8217;s firm drum-beat of generations, and instead have them procreate more evenly over time. That would be more like the way my code has been solving these problems.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

