<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Algorithms on Shai Asher</title><link>https://slow-is-smooth.io/tags/algorithms/</link><description>Recent content in Algorithms on Shai Asher</description><generator>Hugo</generator><language>en-gb</language><lastBuildDate>Fri, 02 Oct 2026 08:00:00 +0300</lastBuildDate><atom:link href="https://slow-is-smooth.io/tags/algorithms/index.xml" rel="self" type="application/rss+xml"/><item><title>The Cleaning Robot Puzzle: A Lower Bound from a Linear Program</title><link>https://slow-is-smooth.io/blog/the-cleaning-robot-puzzle-a-lower-bound-from-a-linear-program/</link><pubDate>Fri, 02 Oct 2026 08:00:00 +0300</pubDate><guid>https://slow-is-smooth.io/blog/the-cleaning-robot-puzzle-a-lower-bound-from-a-linear-program/</guid><description>&lt;p&gt;&lt;em&gt;Part 3&amp;rsquo;s fast route cleans a furnished 40×40 room in 1,327 commands, and all Part 3 could prove is that no route needs fewer than 1,037. Between the two lie 290 commands nobody could account for.&lt;/em&gt;&lt;/p&gt;&#10;&lt;p&gt;This is &lt;strong&gt;Part 8&lt;/strong&gt; of the cleaning robot puzzle, and the first of the parts that take the robot&amp;rsquo;s optimisation problems to the tools operations research really uses. &lt;a href="https://slow-is-smooth.io/blog/the-cleaning-robot-puzzle-four-new-rules/#fewest-commands"&gt;Part 3&lt;/a&gt; asked for the fewest commands that clean the whole floor, built a fast solver, an exact one that gives up on big rooms, and a lower bound from three simple facts. It ended on an open question: &amp;ldquo;On big furnished rooms the gap to the lower bound stays wide. The bound is weak there, and nobody knows how far from the best the fast routes really are.&amp;rdquo;&lt;/p&gt;</description></item><item><title>The Cleaning Robot Puzzle: Five Squares at Every Corner</title><link>https://slow-is-smooth.io/blog/the-cleaning-robot-puzzle-five-squares-at-every-corner/</link><pubDate>Fri, 25 Sep 2026 09:30:00 +0300</pubDate><guid>https://slow-is-smooth.io/blog/the-cleaning-robot-puzzle-five-squares-at-every-corner/</guid><description>&lt;p&gt;&lt;em&gt;Put five squares round every corner of the cleaning robot&amp;rsquo;s floor instead of four, and within ten steps of the dock there are 16,737 fields instead of 221.&lt;/em&gt;&lt;/p&gt;&#10;&lt;p&gt;This is &lt;strong&gt;Part 7&lt;/strong&gt; of the cleaning robot puzzle, and the last of four in which the floor stops being flat. In &lt;a href="https://slow-is-smooth.io/blog/the-cleaning-robot-puzzle-cleaning-a-box/"&gt;Part 6&lt;/a&gt;, three squares met at the corners of a box, each corner was 90° short, and three left turns brought the robot home. This part goes the other way. Five squares meet at &lt;em&gt;every&lt;/em&gt; corner, each corner has 90° too many, and the floor, which can no longer lie flat, turns out to have room for far more fields than any flat floor.&lt;/p&gt;</description></item><item><title>The Cleaning Robot Puzzle: Cleaning a Box</title><link>https://slow-is-smooth.io/blog/the-cleaning-robot-puzzle-cleaning-a-box/</link><pubDate>Fri, 25 Sep 2026 09:00:00 +0300</pubDate><guid>https://slow-is-smooth.io/blog/the-cleaning-robot-puzzle-cleaning-a-box/</guid><description>&lt;p&gt;&lt;em&gt;Send the cleaning robot up the walls of a swimming pool and it finds that driving forward and turning left three times can bring it back to where it started.&lt;/em&gt;&lt;/p&gt;&#10;&lt;p&gt;This is &lt;strong&gt;Part 6&lt;/strong&gt; of the cleaning robot puzzle. &lt;a href="https://slow-is-smooth.io/blog/the-cleaning-robot-puzzle-a-room-that-wraps-around/"&gt;Part 4&lt;/a&gt; glued the room into a torus and &lt;a href="https://slow-is-smooth.io/blog/the-cleaning-robot-puzzle-a-floor-with-a-twist/"&gt;Part 5&lt;/a&gt; gave it a twist, but both floors were still flat: at every corner, four squares met, exactly as on a tiled kitchen floor. This part folds the floor round the corners of a box, where only three squares meet. That one missing square changes what &amp;ldquo;turning left&amp;rdquo; means, rules out a compass on the whole surface, and breaks the checkerboard again.&lt;/p&gt;</description></item><item><title>The Cleaning Robot Puzzle: A Floor with a Twist</title><link>https://slow-is-smooth.io/blog/the-cleaning-robot-puzzle-a-floor-with-a-twist/</link><pubDate>Fri, 25 Sep 2026 08:30:00 +0300</pubDate><guid>https://slow-is-smooth.io/blog/the-cleaning-robot-puzzle-a-floor-with-a-twist/</guid><description>&lt;p&gt;&lt;em&gt;Give the cleaning robot&amp;rsquo;s floor a half twist, like a Möbius strip, and after one lap round the room its up is the map&amp;rsquo;s down, and the commands that cleaned every flat room walk it into the walls.&lt;/em&gt;&lt;/p&gt;&#10;&lt;p&gt;This is &lt;strong&gt;Part 5&lt;/strong&gt; of the cleaning robot puzzle. &lt;a href="https://slow-is-smooth.io/blog/the-cleaning-robot-puzzle-a-room-that-wraps-around/"&gt;Part 4&lt;/a&gt; glued the room&amp;rsquo;s edges into a torus, and the robot lost its ability to name fields by counting moves. This part glues two edges with a twist, and the robot loses something it never knew it had: a compass. On every floor so far, &lt;code&gt;^&lt;/code&gt; meant the same direction everywhere. Here it doesn&amp;rsquo;t.&lt;/p&gt;</description></item><item><title>The Cleaning Robot Puzzle: A Room That Wraps Around</title><link>https://slow-is-smooth.io/blog/the-cleaning-robot-puzzle-a-room-that-wraps-around/</link><pubDate>Fri, 25 Sep 2026 08:00:00 +0300</pubDate><guid>https://slow-is-smooth.io/blog/the-cleaning-robot-puzzle-a-room-that-wraps-around/</guid><description>&lt;p&gt;&lt;em&gt;Glue the cleaning robot&amp;rsquo;s room into a doughnut, so that walking off the right edge brings it back on the left, and the blind robot from Part 3 never stops cleaning.&lt;/em&gt;&lt;/p&gt;&#10;&lt;p&gt;This is &lt;strong&gt;Part 4&lt;/strong&gt; of the cleaning robot puzzle, and the first of four parts in which the floor stops being flat. &lt;a href="https://slow-is-smooth.io/blog/the-cleaning-robot-puzzle/"&gt;Part 1&lt;/a&gt; cleaned a room with a depth-first walk, &lt;a href="https://slow-is-smooth.io/blog/the-cleaning-robot-puzzle-dirt-capacity-and-a-battery/"&gt;Part 2&lt;/a&gt; added dirt, a bag and a battery, and &lt;a href="https://slow-is-smooth.io/blog/the-cleaning-robot-puzzle-four-new-rules/"&gt;Part 3&lt;/a&gt; asked for the fewest commands, took the map away, added a dock and a second robot. Every one of those rooms was a flat grid with a wall round it.&lt;/p&gt;</description></item><item><title>The Cleaning Robot Puzzle: Four New Rules</title><link>https://slow-is-smooth.io/blog/the-cleaning-robot-puzzle-four-new-rules/</link><pubDate>Thu, 24 Sep 2026 13:00:00 +0300</pubDate><guid>https://slow-is-smooth.io/blog/the-cleaning-robot-puzzle-four-new-rules/</guid><description>&lt;p&gt;&lt;em&gt;Ask the cleaning robot for the fewest commands, take away its map, give it a dock that empties its bag, then add a second robot that must not collide with it.&lt;/em&gt;&lt;/p&gt;&#10;&lt;p&gt;&lt;a href="https://slow-is-smooth.io/blog/the-cleaning-robot-puzzle/"&gt;Part 1&lt;/a&gt; and &lt;a href="https://slow-is-smooth.io/blog/the-cleaning-robot-puzzle-dirt-capacity-and-a-battery/"&gt;Part 2&lt;/a&gt; kept the robot&amp;rsquo;s world simple: it knew the map, it worked alone, and any complete route was good enough. This part takes those comforts away one at a time. Each question changes a single rule, and each change turns the puzzle into a different classic problem.&lt;/p&gt;</description></item><item><title>The Cleaning Robot Puzzle: Dirt, Capacity and a Battery</title><link>https://slow-is-smooth.io/blog/the-cleaning-robot-puzzle-dirt-capacity-and-a-battery/</link><pubDate>Thu, 24 Sep 2026 12:30:00 +0300</pubDate><guid>https://slow-is-smooth.io/blog/the-cleaning-robot-puzzle-dirt-capacity-and-a-battery/</guid><description>&lt;p&gt;&lt;em&gt;Every floor field gets some dirt, the robot gets a bag that fills up and then a battery that runs out, and the cleaning robot puzzle turns into subset sum, a connected knapsack and the orienteering problem.&lt;/em&gt;&lt;/p&gt;&#10;&lt;p&gt;In &lt;a href="https://slow-is-smooth.io/blog/the-cleaning-robot-puzzle/"&gt;Part 1&lt;/a&gt; the robot could clean everything, so any complete walk was good enough. This part changes the rules so that choices matter: the robot can&amp;rsquo;t take everything any more, so it has to decide what to take. It builds on Part 1&amp;rsquo;s depth-first walk and assumes you can read Python.&lt;/p&gt;</description></item><item><title>The Cleaning Robot Puzzle</title><link>https://slow-is-smooth.io/blog/the-cleaning-robot-puzzle/</link><pubDate>Thu, 24 Sep 2026 12:00:00 +0300</pubDate><guid>https://slow-is-smooth.io/blog/the-cleaning-robot-puzzle/</guid><description>&lt;p&gt;&lt;em&gt;One robot, rooms full of furniture, a 50,000-command budget — and one short depth-first search that cleans all of it.&lt;/em&gt;&lt;/p&gt;&#10;&lt;p&gt;This is &lt;strong&gt;Part 1&lt;/strong&gt;, and it solves the original puzzle. &lt;strong&gt;Part 2&lt;/strong&gt; changes the rules: every floor field gets some dirt, the robot gets a bag that can fill up, and then a battery that runs out. It turns a textbook traversal into a real optimisation problem. &lt;strong&gt;Part 3&lt;/strong&gt; asks for the shortest route, takes away the map, adds a dock where the bag empties, and brings in a second robot. &lt;strong&gt;Parts 4 to 7&lt;/strong&gt; keep the square fields but stop the floor being flat: a room that wraps around, a strip with a twist, the walls of a box, and a floor with five squares at every corner. &lt;strong&gt;Parts 8 to 11&lt;/strong&gt; go back to the flat floor and take its optimisation problems to the tools of operations research, starting with a linear program that bounds the shortest route from below.&lt;/p&gt;</description></item></channel></rss>