<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>LAMBDAPHONE &#187; 17&#215;17</title>
	<atom:link href="http://coder.bsimmons.name/blog/tag/17x17/feed/" rel="self" type="application/rss+xml" />
	<link>http://coder.bsimmons.name/blog</link>
	<description>fragmentary ideas  ䷿  intellectual what-nots  ䷷  and haskell programming  ䷴</description>
	<lastBuildDate>Sun, 29 Jan 2012 17:24:54 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>17&#215;17: some Simulated Annealing updates</title>
		<link>http://coder.bsimmons.name/blog/2010/07/17x17-some-simulated-annealing-updates/</link>
		<comments>http://coder.bsimmons.name/blog/2010/07/17x17-some-simulated-annealing-updates/#comments</comments>
		<pubDate>Sun, 01 Aug 2010 02:46:06 +0000</pubDate>
		<dc:creator>jberryman</dc:creator>
				<category><![CDATA[haskell]]></category>
		<category><![CDATA[17x17]]></category>
		<category><![CDATA[Graph Theory]]></category>
		<category><![CDATA[heuristics]]></category>
		<category><![CDATA[short]]></category>
		<category><![CDATA[theory]]></category>

		<guid isPermaLink="false">http://coder.bsimmons.name/blog/?p=459</guid>
		<description><![CDATA[<blockquote><p><em>Note: this is part of a <a href="http://coder.bsimmons.name/blog/tag/17x17/">series of posts</a> is related to the &#8220;<a href="http://blog.computationalcomplexity.org/2009/11/17x17-challenge-worth-28900-this-is-not.html">17&#215;17 Challenge</a>&#8221; posted by Bill Gasarch. The goal is to color cells of a 17 by 17 grid, using only four colors, such that no</em></p></blockquote><p>&#8230; <a href="http://coder.bsimmons.name/blog/2010/07/17x17-some-simulated-annealing-updates/" class="read_more">   [ R E A D &#124; M O R E ]</a></p>]]></description>
			<content:encoded><![CDATA[<blockquote><p><em>Note: this is part of a <a href="http://coder.bsimmons.name/blog/tag/17x17/">series of posts</a> is related to the &#8220;<a href="http://blog.computationalcomplexity.org/2009/11/17x17-challenge-worth-28900-this-is-not.html">17&#215;17 Challenge</a>&#8221; posted by Bill Gasarch. The goal is to color cells of a 17 by 17 grid, using only four colors, such that no rectangle is formed from four cells of the same color.</em></p></blockquote>
<p>Just a few follow-ups to my previous <a href="http://coder.bsimmons.name/blog/2010/07/17x17-a-simulated-annealing-approach-using-thresholds/">post in which I use a simulated annealing-type algorithm</a> to find a good (hopefully complete) cover of a grid by swapping rows and columns from four identical sub-grids of 74 colors.</p>
<h2>Easing into new thresholds</h2>
<p>I modified my algorithm so that the likelihood of jumping into the highest permitted energy level is decreased over time; thus instead of having an abrupt transition to a new threshold, resulting in a steep dive, we instead <em>ease into</em> the new energy level. </p>
<p>Here is a graph of a run with the adjusted meta-heuristic (in blue) alongside a previous abrupt threshold transition run (in black). You can check compare it to the <a href="http://coder.bsimmons.name/blog/wp-content/uploads/5-2.combined-annotated.png">graph from the previous post</a>:</p>
<p><a href="http://coder.bsimmons.name/blog/wp-content/uploads/output.10000.5.smooth_vs_jagged.png"><img src="http://coder.bsimmons.name/blog/wp-content/uploads/output.10000.5.smooth_vs_jagged-300x81.png" alt="a more smooth graph vs. a graph with abrupt changes at each threshold change" title="output.10000.5.smooth_vs_jagged" width="300" height="81" class="aligncenter size-medium wp-image-460" /></a></p>
<p><span id="more-459"></span></p>
<p>Unfortunately this change didn&#8217;t cause any improvement in the solutions generated. They still seem to flatten at a grid with 19 &#8211; 22 uncolored cells.</p>
<h2>Testing a combination of sub-grids with known good solution</h2>
<p>I wondered if the lower bound I was smacking into was caused by the fact that I was trying to find a combination of four permutations <em>of the same subset</em>, and perhaps this particular subset didn&#8217;t mesh all that well with itself.</p>
<p>In the original blog posting laying out this challenge there is four-coloring of 17&#215;17 with only one cell left un-colorable in a truly painful refactoring process, I modified my script to take four separate and distinct sub-grids and perform the same shuffling procedure.</p>
<p>Rather than find the original arrangement of the colored subsets or one nearly as good, the program settles on a solution with around 30 uncolored cells. That is worse than my original version, corresponding to the fact that there are fewer cells to work with in this latter set of colored subsets: 288 vs. 296.</p>
<h2>Conclusion</h2>
<p>This doesn&#8217;t say anything about whether a full-cover can likely be obtained by permuting four overlapping copies of a single subset of colors. It does tell us that either my code is flawed, this isn&#8217;t a particularly effective method for this kind of search, or it needs to be tuned better.</p>
]]></content:encoded>
			<wfw:commentRss>http://coder.bsimmons.name/blog/2010/07/17x17-some-simulated-annealing-updates/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>17&#215;17: A Simulated Annealing approach using thresholds</title>
		<link>http://coder.bsimmons.name/blog/2010/07/17x17-a-simulated-annealing-approach-using-thresholds/</link>
		<comments>http://coder.bsimmons.name/blog/2010/07/17x17-a-simulated-annealing-approach-using-thresholds/#comments</comments>
		<pubDate>Sat, 10 Jul 2010 17:05:07 +0000</pubDate>
		<dc:creator>jberryman</dc:creator>
				<category><![CDATA[haskell]]></category>
		<category><![CDATA[17x17]]></category>
		<category><![CDATA[algorithm]]></category>
		<category><![CDATA[Array]]></category>
		<category><![CDATA[heuristics]]></category>

		<guid isPermaLink="false">http://coder.bsimmons.name/blog/?p=443</guid>
		<description><![CDATA[<blockquote><p><em>Note: this is part of a <a href="http://coder.bsimmons.name/blog/tag/17x17/">series of posts</a> is related to the &#8220;<a href="http://blog.computationalcomplexity.org/2009/11/17x17-challenge-worth-28900-this-is-not.html">17&#215;17 Challenge</a>&#8221; posted by Bill Gasarch. The goal is to color cells of a 17 by 17 grid, using only four colors, such that no</em></p></blockquote><p>&#8230; <a href="http://coder.bsimmons.name/blog/2010/07/17x17-a-simulated-annealing-approach-using-thresholds/" class="read_more">   [ R E A D &#124; M O R E ]</a></p>]]></description>
			<content:encoded><![CDATA[<blockquote><p><em>Note: this is part of a <a href="http://coder.bsimmons.name/blog/tag/17x17/">series of posts</a> is related to the &#8220;<a href="http://blog.computationalcomplexity.org/2009/11/17x17-challenge-worth-28900-this-is-not.html">17&#215;17 Challenge</a>&#8221; posted by Bill Gasarch. The goal is to color cells of a 17 by 17 grid, using only four colors, such that no rectangle is formed from four cells of the same color.</em></p></blockquote>
<p>This is something I&#8217;ve been wanting to play with for months now, but haven&#8217;t made the time to implement: I wondered if <a href="http://en.wikipedia.org/wiki/Simulated_annealing">simulated annealing</a> techniques could be effective in finding a complete grid covering. </p>
<p>We would simply start with four copies of the 74-color grid and swap their rows and columns around, within each color set, trying to cover all of the cells by the union of the four subsets. So all of the sets of cells of a single color are fundamentally simply different permutations of the same 74-cell rectangle-free Graph. </p>
<p>Here is an illustration of the concept. Our algorithm starts with all four colored sets of cell overlapping (the red cells are on top, covering the other three colors):</p>
<p><a href="http://coder.bsimmons.name/blog/wp-content/uploads/Screenshot-74-coloring.png"><img src="http://coder.bsimmons.name/blog/wp-content/uploads/Screenshot-74-coloring-285x300.png" alt="Illustration showing four sets of colored cells, all overlapping in every cell" title="Screenshot - 74-coloring" width="285" height="300" class="aligncenter size-medium wp-image-446" /></a></p>
<p>&#8230;then we swap two rows or two columns from a colored subset of cells, until the four colored subsets spread out covering as much of the grid as possible. Here we cover all but 21 cells:</p>
<p><a href="http://coder.bsimmons.name/blog/wp-content/uploads/Screenshot-20-free.png"><img src="http://coder.bsimmons.name/blog/wp-content/uploads/Screenshot-20-free-300x291.png" alt="Four layers of cells of colors RGBY, spread out to cover most of the grid" title="Screenshot - 20 free" width="300" height="291" class="aligncenter size-medium wp-image-447" /></a></p>
<p><span id="more-443"></span></p>
<h2>A Brief Intro to Simulated Annealing</h2>
<p>Simulated Annealing is a bit of an intimidating term (has its origins in <a href="http://en.wikipedia.org/wiki/Annealing_%28metallurgy%29">metallurgy</a> of all things), but the idea is simple: you start off with an initial solution (in my case, four sets of cells, all of which overlap) and then you mutate it randomly by choosing a random &#8220;neighbor&#8221; solution (in my case, a grid in which two rows or two columns of the same color are swapped).</p>
<p>You score these solutions so that you can compare a current solution with a proposed mutated solution, and here&#8217;s the key: </p>
<blockquote><p>
You begin by accepting nearly every mutation, whether it improves your solution or not. But as the procedure progresses you become more picky about &#8220;how much worse&#8221; a new solution can be from the previous one.
</p></blockquote>
<p>So in the classic <a href="http://en.wikipedia.org/wiki/Travelling_salesman_problem">Traveling Salesman Problem</a> a neighbor solution would be a new route that goes from city C to city E, where in the last solution we went from city E to city C.</p>
<h3>Threshold Acceptance</h3>
<p>There are various ways of accomplishing the task of &#8220;ratcheting down&#8221; the computation over time. The traditional method (the method most matching the metallurgical metaphor, if you will) is to have a function that computes the probability of a proposed change being accepted. This probability function changes over time, such that as we progress it becomes more and more unlikely that a solution worse than the previous will be accepted.</p>
<p>Another method, and the one I chose to implement, seems to be referred to as <a href="http://comisef.wikidot.com/concept:thresholdaccepting">Threshold Accepting</a>; instead of having a probability function, you accept all mutations that are below a certain threshold of change from the previous solution. The threshold becomes more strict over time.</p>
<p>So in our case we might start off with a threshold of five, meaning that we will accept all changes that give us a <em>worse</em> solution of no more than 5 new un-colored cells. So for example: if swapping blue rows 5 and 12 create a new solution with 6 fewer colored (covered) cells from the previous solution (i.e. a worse solution by six), then it won&#8217;t be accepted by our meta-algorithm at this stage.</p>
<h2>Notes on the implementation</h2>
<p>The approach I tried to describe above was really attractive to me because it short-circuits the whole complex &#8220;rectangle-free&#8221; constraint entirely. We simply start with a known rectangle-free subset and see if we can make four copies fit together. </p>
<p>Also, because we swap two rows or columns at a time, we need only look at the local change of score produced by the swap and then add it to the global score to obtain the new global score.</p>
<p>The astronomical number (<code>17!^2</code>) of possible permutations of a single rectangle-free subset give me hope that this approach could work, but that is an open question as far as I know. </p>
<p>I wrote this first draft of the script in haskell (as usual), and was happy with how fast it is, thanks in large part to the <a href="http://hackage.haskell.org/cgi-bin/hackage-scripts/package/vector">vector library</a>, which was a pleasure to work with. The code uses 4 pairs of <code>Vector</code>s (arrays of Ints), 8 in total, each of which represent a row or column ordering of one of the four colors. </p>
<p>We store the original 74-cell rectangle-free subset as a 2D <code>Array (Int,Int) Bool</code>. The pairs of Vectors act as references to row or column slices of this 2D array.</p>
<p>When we want to score a swap, we have to &#8220;render&#8221; all four colors of the pair of rows/columns in question using our 2D reference array. Then a swap consists of swapping two Ints in a single Vector. This is much more friendly on more poor laptop than if we were to try storing all four color subsets as 2D arrays and swapping them around!</p>
<p>You can <a href="http://coder.bsimmons.name/code/simulatedAnnealing.lhs">download the code here</a>, but mind it isn&#8217;t incredibly pretty.</p>
<h2>Initial findings</h2>
<p>The best I&#8217;ve done with this initial version is a grid with 19 empty cells:</p>
<p><a href="http://coder.bsimmons.name/blog/wp-content/uploads/Screenshot-19-free.png"><img src="http://coder.bsimmons.name/blog/wp-content/uploads/Screenshot-19-free-283x300.png" alt="A 17 by 17 grid showing all but 19 cells colored" title="Screenshot - 19 free" width="283" height="300" class="aligncenter size-medium wp-image-448" /></a></p>
<p>It is obvious though that the heuristic needs a lot of tuning, and that in my case the &#8220;Threshold Accepting&#8221; approach isn&#8217;t working well. That is because it is far too granular: we get from complete disorder to a minimum in just a handful of threshold rounds.</p>
<p>Here is a quick graph overlaying two runs, one of which starts with a threshold (each threshold round bracketed in black) of 5, the other (in blue) starts with a threshold of 2. The Y-axis is the number of uncolored cells in the grid at the current solution:</p>
<p><a href="http://coder.bsimmons.name/blog/wp-content/uploads/5-2.combined-annotated.png"><img src="http://coder.bsimmons.name/blog/wp-content/uploads/5-2.combined-annotated-300x136.png" alt="" title="5-2.combined-annotated" width="300" height="136" class="aligncenter size-medium wp-image-449" /></a></p>
<p>You can see that both basically look like <a href="http://en.wikipedia.org/wiki/Brownian_motion">random Brownian walks</a> during the course of a threshold round, and quickly drop to a lower energy level (better solution) as soon as the threshold is tightened. Most dramatic is the jump when we go from 2 to 1.</p>
<p>This looks like we&#8217;re being thrust into a local minima, which is the opposite of what we want here. But whether a more finely-tuned annealing schedule can do better is anyone&#8217;s guess.</p>
<h2>What&#8217;s next?</h2>
<p>It should be very simple to implement a more traditional annealing procedure that would ease us into lower &#8220;energy levels&#8221; without the harsh dives we get from using only a handful of threshold levels. So that is what is next on the agenda for this problem.</p>
<p>If this annealing business looks promising after I master the black art of &#8220;tuning the meta-heuristic&#8221;, it would be cool to come up with a single-coloring algorithm, capable of generating rectangle free colorings of 72,73, or 74 cells. We would then feed those solutions into our annealing framework, finding the best combinations of colorings via a genetic algorithm or the like.</p>
<p>But that leads to the question I&#8217;ve posed earlier: it is sometimes trivial to determine if two colorings are &#8220;unique&#8221; (i.e. by counting colored cells in rows and columns); but when it isn&#8217;t trivial, determining whether two colorings are <em>&#8220;equivalent&#8221;</em> seems to be a very difficult problem. </p>
<p>What a hole I&#8217;ve fallen into&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://coder.bsimmons.name/blog/2010/07/17x17-a-simulated-annealing-approach-using-thresholds/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>17&#215;17: Further Thoughts &amp; Some Pretty Pictures</title>
		<link>http://coder.bsimmons.name/blog/2010/06/17x17-further-thoughts-some-pretty-pictures/</link>
		<comments>http://coder.bsimmons.name/blog/2010/06/17x17-further-thoughts-some-pretty-pictures/#comments</comments>
		<pubDate>Tue, 01 Jun 2010 20:35:06 +0000</pubDate>
		<dc:creator>jberryman</dc:creator>
				<category><![CDATA[haskell]]></category>
		<category><![CDATA[17x17]]></category>
		<category><![CDATA[Graph Theory]]></category>

		<guid isPermaLink="false">http://coder.bsimmons.name/blog/?p=421</guid>
		<description><![CDATA[<blockquote><p><em>Note: this is part of a <a href="http://coder.bsimmons.name/blog/tag/17x17/">series of posts</a> is related to the &#8220;<a href="http://blog.computationalcomplexity.org/2009/11/17x17-challenge-worth-28900-this-is-not.html">17&#215;17 Challenge</a>&#8221; posted by Bill Gasarch. The goal is to color cells of a 17 by 17 grid, using only four colors, such that no</em></p></blockquote><p>&#8230; <a href="http://coder.bsimmons.name/blog/2010/06/17x17-further-thoughts-some-pretty-pictures/" class="read_more">   [ R E A D &#124; M O R E ]</a></p>]]></description>
			<content:encoded><![CDATA[<blockquote><p><em>Note: this is part of a <a href="http://coder.bsimmons.name/blog/tag/17x17/">series of posts</a> is related to the &#8220;<a href="http://blog.computationalcomplexity.org/2009/11/17x17-challenge-worth-28900-this-is-not.html">17&#215;17 Challenge</a>&#8221; posted by Bill Gasarch. The goal is to color cells of a 17 by 17 grid, using only four colors, such that no rectangle is formed from four cells of the same color.</em></p></blockquote>
<p>An almost silly amount of time passes between my new ideas on this problem and investigating/coding those ideas, but I&#8217;m trying to be better about helping my thoughts see the light of day before I get entirely bored of them. </p>
<p>So in that spirit, here are a few more thoughts on the 17&#215;17 Problem investigated.</p>
<h3>Will Graph Layout Algorithms show Symmetry?</h3>
<p><a href="http://en.wikipedia.org/wiki/Force-based_algorithms_%28graph_drawing%29">Force-based algorithms</a> tend to be good at creating symmetrical layouts of graphs. The idea is to translate a Graph into a system of springs (edges) and charged particles (nodes). You then run a simulation of this 2-dimensional sytem and the graph eventually should work itself out into some equilibrium state. </p>
<p>At that point hopefully you get a layout which is more clear and perhaps makes clear some important relationships of the Graph.</p>
<p>I used the <a href="http://www.graphviz.org/">graphviz software suite</a> to do the force-directed layouts and wrote some ugly code to coax some rectangle-free single-colorings into the graphviz file format. I hoped that some of the <a href="http://coder.bsimmons.name/blog/2010/03/17x17-some-thoughts-on-the-problem/">single-</a> and <a href="http://coder.bsimmons.name/blog/2010/04/17x17-some-attempts-at-doubly-symmetrical-rotations/">double-symmetrical</a> relationships that I noticed would emerge in the process.</p>
<p><span id="more-421"></span></p>
<p>This worked perfectly for a small 5&#215;5 cell single-coloring:</p>
<p><a href="http://coder.bsimmons.name/blog/wp-content/uploads/5x5.graph.png"><img src="http://coder.bsimmons.name/blog/wp-content/uploads/5x5.graph-231x300.png" alt="A graph showing symmetry of a 5x5 grid" title="5x5.graph" width="231" height="300" class="aligncenter size-medium wp-image-424" /></a></p>
<p>Since what we&#8217;re really looking for are symmetrical relationships between <em>rows and columns</em> rather than between cells, I&#8217;ve expressed the graph above as colored cell nodes connected to nodes representing the row and the column in which the cell resides.</p>
<p>I realized I could tighten up the graph by getting rid of the nodes for the cells themselves and just showing Column nodes connecting to Row nodes, where an edge exists between the two when a colored cell lies on their intersection. (note: the rows and columns here don&#8217;t correspond to the ones above):</p>
<p><a href="http://coder.bsimmons.name/blog/wp-content/uploads/5x5.csv_.graph.png"><img src="http://coder.bsimmons.name/blog/wp-content/uploads/5x5.csv_.graph-300x245.png" alt="A tighter graph of the same" title="5x5.csv.graph" width="300" height="245" class="aligncenter size-medium wp-image-425" /></a></p>
<p>Unfortunately this wasn&#8217;t effective for the 17&#215;17 single-coloring:</p>
<p><a href="http://coder.bsimmons.name/blog/wp-content/uploads/17x17-small1.png"><img src="http://coder.bsimmons.name/blog/wp-content/uploads/17x17-small1-290x300.png" alt="A messy graph with 74 nodes" title="17x17-small" width="290" height="300" class="aligncenter size-medium wp-image-428" /></a></p>
<p>I suppose there were too many nodes and the symmetrical relationships are too tenuous to emerge. That said, I&#8217;m no graphviz expert so it&#8217;s quite possible that this could work with the right black magic.</p>
<h3>Investigating Weights of Colored and &#8220;Toxic&#8221; Cells</h3>
<blockquote><p>Note: I&#8217;ve started calling cells which have been made un-colorable (because they would form a rectangle of that color) <strong>&#8220;toxic&#8221;</strong>; so that&#8217;s how I&#8217;ll refer to them here.</p></blockquote>
<p>I wanted to investigate the relationships between colored cells and the cells that they make toxic (and vice versa), so I coded up a Haskell script that parsed a CSV format grid and did the following:</p>
<ol>
<li>For each colored cell, show the toxic cells that it has a part in making toxic</li>
<li>For each toxic cell, list all the triplets of colored cells that each make this cell toxic</li>
</ol>
<p>What I was primarily looking for were some insights that could lead to an heuristic to guide some kind of ladder-climbing search algorithm. For example if all the colored cells </p>
<p>The first point wasn&#8217;t particularly interesting to me: in the 17&#215;17 grid of 74 colored, each colored cell helped toxify between 31 and 40 un-colorable cells, which corresponded with the number of row/column neighbors that a colored cell had.</p>
<p>What was more interesting was when I looked at the graph from the perspective of the toxic (blank) cells. </p>
<p>Each toxic cell had 3, 4 or 5 unique triplets of colored cells making it toxic. Here you can see a kind of heatmap with the toxic cells in shades of gray, corresponding to how many different 3-groups of colored cells help make this toxic:</p>
<p><iframe width='500' height='500' frameborder='0' src='http://spreadsheets.google.com/pub?key=0AifWmvDBLwGodFdwVHVPNDI1WC1LbzNpQXd0VDlpLWc&#038;hl=en&#038;output=html&#038;widget=true'></iframe></p>
<h3>An Obvious Property of Toxic Cells</h3>
<p>Looking at toxic cells helped me realize an interesting property of those cells: </p>
<blockquote><p>
There is a one-to-one correspondence between a toxic cell&#8217;s row neighbors and its column neighbors in rendering the cell in question toxic.
</p></blockquote>
<p>That is for a toxic cell <em>T</em> a colored cell in <em>T</em>&#8216;s column will team up with at most a single colored cell from <em>T</em>&#8216;s row (and vice versa) in toxifying our cell. If this weren&#8217;t the case, it would imply a rectangle on our grid (you can work it out on paper if you like).</p>
<p>To go further, this means that if <em>T</em> contains a colored cell in its row and its column, <em>both of which</em> don&#8217;t contribute to making <em>T</em> toxic, then <em>T</em> is essentially not doing it&#8217;s job as well as it can. That is we might be able to add a new colored cell to form a triplet with those two colored cells, adding a new colored cell to our graph and making <em>T</em> a more effective &#8220;rectangle sink&#8221;. </p>
<p>Here&#8217;s an illustration of two different toxic cells and their respective (and partially overlapping) sets of toxifying triplets. The second tab shows how we might &#8220;improve&#8221; one of the toxic cells:</p>
<p><iframe width='500' height='500' frameborder='0' src='http://spreadsheets.google.com/pub?key=0AifWmvDBLwGodG5xNUtOajVnb3EwUlJqOXFnS005ZEE&#038;output=html&#038;widget=true'></iframe></p>
<p>Of course adding a colored cell to form a triplet with the two cells in <em>T</em>&#8216;s row, but not affecting <em>T</em> would very likely cause other currently colored cells to become toxic in the process.</p>
<h3>Conclusion</h3>
<p>I&#8217;m going to try code up an algorithm that attempts to produce an optimal single-coloring by trying to make toxic cells as effective as possible, e.g. by looking at where we can add a single colored cell and bridge several ineffective pairs at one time. I&#8217;ll also look at some other more conventional search strategies.</p>
<p>My next and hopefully last post on this junk should be of shorter and of more general compsci interest.</p>
]]></content:encoded>
			<wfw:commentRss>http://coder.bsimmons.name/blog/2010/06/17x17-further-thoughts-some-pretty-pictures/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>17&#215;17: Some Attempts at Doubly-Symmetrical Rotations</title>
		<link>http://coder.bsimmons.name/blog/2010/04/17x17-some-attempts-at-doubly-symmetrical-rotations/</link>
		<comments>http://coder.bsimmons.name/blog/2010/04/17x17-some-attempts-at-doubly-symmetrical-rotations/#comments</comments>
		<pubDate>Fri, 09 Apr 2010 00:58:23 +0000</pubDate>
		<dc:creator>jberryman</dc:creator>
				<category><![CDATA[haskell]]></category>
		<category><![CDATA[17x17]]></category>
		<category><![CDATA[giving up]]></category>
		<category><![CDATA[Graph Theory]]></category>

		<guid isPermaLink="false">http://coder.bsimmons.name/blog/?p=400</guid>
		<description><![CDATA[<blockquote><p><em>Note: this is part of a <a href="http://coder.bsimmons.name/blog/tag/17x17/">series of posts</a> is related to the &#8220;<a href="http://blog.computationalcomplexity.org/2009/11/17x17-challenge-worth-28900-this-is-not.html">17&#215;17 Challenge</a>&#8221; posted by Bill Gasarch. The goal is to color cells of a 17 by 17 grid, using only four colors, such that no</em></p></blockquote><p>&#8230; <a href="http://coder.bsimmons.name/blog/2010/04/17x17-some-attempts-at-doubly-symmetrical-rotations/" class="read_more">   [ R E A D &#124; M O R E ]</a></p>]]></description>
			<content:encoded><![CDATA[<blockquote><p><em>Note: this is part of a <a href="http://coder.bsimmons.name/blog/tag/17x17/">series of posts</a> is related to the &#8220;<a href="http://blog.computationalcomplexity.org/2009/11/17x17-challenge-worth-28900-this-is-not.html">17&#215;17 Challenge</a>&#8221; posted by Bill Gasarch. The goal is to color cells of a 17 by 17 grid, using only four colors, such that no rectangle is formed from four cells of the same color.</em></p></blockquote>
<p>In a <a href="http://coder.bsimmons.name/blog/2010/03/17x17-symmetric-single-colorings-and-some-graph-theory/">previous post</a> I presented rotations of some single-color rectangle-free grids which were symmetrical along a diagonal axis. I also noticed that, of the single-colorings of optimal size which I could generate, all with an odd number side-length could be made symmetrical along <em>both</em> diagonals (the evens could not):</p>
<blockquote><p>
<iframe width='400' height='400' frameborder='0' src='http://spreadsheets.google.com/pub?key=tZ-BHhZDGdOR5g1-dbBTr0w&#038;output=html&#038;widget=true'></iframe></p></blockquote>
<p>Perhaps <em>all</em> odd-sided optimal single-colorings are doubly-symmetrical in one of their rotations! That would be a cool thing to learn, and it would also mean that if we wanted to generate an optimal coloring, then our search space would be roughly 1/4 of the grid.</p>
<p><span id="more-400"></span></p>
<p>So I thought I would see if I could rotate the known 74-color grid into a doubly-symmetrical arrangement&#8230; and I have to admit defeat.:</p>
<blockquote><p>
<iframe width='400' height='400' frameborder='0' src='http://spreadsheets.google.com/pub?key=t8iZEIZLeWWsxiRabkJvIDQ&#038;single=true&#038;gid=7&#038;output=html&#038;widget=true'></iframe></p></blockquote>
<p>The orange squares mark discrepancies I couldn&#8217;t resolve. It could be that it is true that all optimal (having the greatest number of colored cells possible for the grid size) single colorings <em>can</em> be made doubly symmetrical and that the 74 colors in 17&#215;17 grid is less than optimal. It could also mean I suck at moving rows and columns around in google spreadsheet. Either way, I&#8217;m done with this line of investigation for now.</p>
<p>Next I would like to jump into actually trying to generate 4-colorings of 17&#215;17, using some informed search algorithms and ladder climbing techniques. </p>
]]></content:encoded>
			<wfw:commentRss>http://coder.bsimmons.name/blog/2010/04/17x17-some-attempts-at-doubly-symmetrical-rotations/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>17&#215;17: More about symmetry and a new rotation</title>
		<link>http://coder.bsimmons.name/blog/2010/03/17x17-more-about-symmetry-and-a-new-rotation/</link>
		<comments>http://coder.bsimmons.name/blog/2010/03/17x17-more-about-symmetry-and-a-new-rotation/#comments</comments>
		<pubDate>Thu, 18 Mar 2010 19:17:55 +0000</pubDate>
		<dc:creator>jberryman</dc:creator>
				<category><![CDATA[haskell]]></category>
		<category><![CDATA[17x17]]></category>
		<category><![CDATA[algorithm]]></category>
		<category><![CDATA[sequences]]></category>

		<guid isPermaLink="false">http://coder.bsimmons.name/blog/?p=362</guid>
		<description><![CDATA[<blockquote><p><em>Note: this is part of a <a href="http://coder.bsimmons.name/blog/tag/17x17/">series of posts</a> is related to the &#8220;<a href="http://blog.computationalcomplexity.org/2009/11/17x17-challenge-worth-28900-this-is-not.html">17&#215;17 Challenge</a>&#8221; posted by Bill Gasarch. The goal is to color cells of a 17 by 17 grid, using only four colors, such that no</em></p></blockquote><p>&#8230; <a href="http://coder.bsimmons.name/blog/2010/03/17x17-more-about-symmetry-and-a-new-rotation/" class="read_more">   [ R E A D &#124; M O R E ]</a></p>]]></description>
			<content:encoded><![CDATA[<blockquote><p><em>Note: this is part of a <a href="http://coder.bsimmons.name/blog/tag/17x17/">series of posts</a> is related to the &#8220;<a href="http://blog.computationalcomplexity.org/2009/11/17x17-challenge-worth-28900-this-is-not.html">17&#215;17 Challenge</a>&#8221; posted by Bill Gasarch. The goal is to color cells of a 17 by 17 grid, using only four colors, such that no rectangle is formed from four cells of the same color.</em></p></blockquote>
<p>In my <a href="http://coder.bsimmons.name/blog/2010/03/17x17-symmetric-single-colorings-and-some-graph-theory/">last post</a>, I gave a symmetrical rotation of the known 74-cell single-coloring. I want to use a slight variation of that grid to show why I think treating the grids as symmetrical will help us in solving this problem.</p>
<p>Here is a new spreadsheet, with several panes you can click through on the bottom. Panes ONE through FIVE represent the first few rows of a single-coloring in which we avoid making any real choices, thanks to a few assumptions we make (I&#8217;ll come back to that).</p>
<p>Orange represents the row we&#8217;re coloring, gray cells are rectangle forming cells (in which marks are not allowed), and blue cells represent what I consider to be the real search-space:</p>
<blockquote><p>
<iframe width='425' height='400' frameborder='0' src='http://spreadsheets.google.com/pub?key=tmOFAqHDqtADZJqwWOeenIw&#038;output=html&#038;widget=true'></iframe></p></blockquote>
<p><em><br />
NOTE: We&#8217;re simply using another automorphism of the original 74-coloring, i.e. a series of rotations that preserve all the significant attributes of the graph. </em></p>
<p><span id="more-362"></span></p>
<h3>Making Coloring Decisions</h3>
<p>We can choose, arbitrarily, to start with a 5-cell row starting on the cell in the upper left. This is our first decision: if it were that in an optimal single-coloring of 17&#215;17 <em>no</em> row with five colored cells shared a cell with <em>any</em> column with five colored cells, then we would have made a poor decision.</p>
<p>But given that in the 74-coloring that we have, <em>all</em> 5-colored-cell rows share a cell with a 5-colored column, we can probably assume that at least one will in our optimal single-coloring. So our first row (in pane 1) is a non-decision.</p>
<p>We continue with the second row by dumping 3 cells as soon as we can (i.e. as far to the left as possible. The only decision made here is in whether to make row two a row of four or five. But as we can see very quickly (and as a shallow search algorithm would see very quickly), making row 2 a five-colored-cell row would force us into forming a 3-cell row out of row five.</p>
<p>So in row 2 we have an easy decision (seeing that we would soon regret creating a 5-cell row) based on our assumption that a good singly-colored grid will have its cells spread evenly over rows &#038; columns. </p>
<p>And we have the non-decision of the column placement of those three cells: because identical columns (in this case empty columns) can be freely swapped without changing anything, there is no need to try every combination of column placement for the row. We put off our decision making for later. </p>
<p>We continue on in the same way.</p>
<h3>Search Ideas</h3>
<p>I&#8217;m coding up a program to try to generate good grids based on some heuristics. I think that a <a href="http://en.wikipedia.org/wiki/Minimax">minimax</a> type solution might be good: in which the coloring of a cell is assigned a point-value based on how many future cells it makes unusable. I could then keep track of which previous cells were complicit in forming potential rectangles and back-track at apparently-bad decisions: i.e. <a href="http://en.wikipedia.org/wiki/Hill_climbing">hill climbing</a>.</p>
<p>I may try to formulate the algorithm like a game and see if I can use the <a href="http://hackage.haskell.org/package/game-tree-0.1.0.0">game-tree module</a> by Colin Adams.</p>
<h3>Conclusion</h3>
<p>It seems to me that the key to the problem of a single-coloring is shrinking the search-space by eliminating false-choices. Treating the graph as it&#8217;s symmetrical (by our definition of symmetrical) automorphism is one way: suddenly the search space becomes the shaded area in the graph above.</p>
<p>Thankfully, my next post will be haskell-related and have nothing to do with Grids.</p>
]]></content:encoded>
			<wfw:commentRss>http://coder.bsimmons.name/blog/2010/03/17x17-more-about-symmetry-and-a-new-rotation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using disk
Database Caching 6/15 queries in 0.041 seconds using disk

Served from: coder.bsimmons.name @ 2012-02-05 11:04:58 -->
