<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://sokobano.de/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Sunshine</id>
	<title>Sokoban Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="http://sokobano.de/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Sunshine"/>
	<link rel="alternate" type="text/html" href="http://sokobano.de/wiki/index.php?title=Special:Contributions/Sunshine"/>
	<updated>2026-04-17T17:29:14Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.6</generator>
	<entry>
		<id>http://sokobano.de/wiki/index.php?title=Deadlocks&amp;diff=8095</id>
		<title>Deadlocks</title>
		<link rel="alternate" type="text/html" href="http://sokobano.de/wiki/index.php?title=Deadlocks&amp;diff=8095"/>
		<updated>2024-03-20T16:57:01Z</updated>

		<summary type="html">&lt;p&gt;Sunshine: /* Deadlocks */ fix &amp;quot;his&amp;quot; to &amp;quot;This&amp;quot;; drop unnecessary &amp;lt;br&amp;gt; and malformed &amp;lt;/br&amp;gt;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= &#039;&#039;&#039;Deadlocks&#039;&#039;&#039; =&lt;br /&gt;
&lt;br /&gt;
Due to the limitation of only being able to push a box, but never pull it, a level can become &amp;quot;deadlocked&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
This means that the level can&#039;t be solved, no matter what the user does. The only way to solve the level is to undo a move or restart the level.&lt;br /&gt;
&lt;br /&gt;
An important insight for recognizing deadlocks is that not all deadlocks require all the boxes in the puzzle. A single box in the wrong position can create a deadlock, regardless of where other boxes are positioned in the puzzle.&lt;br /&gt;
&lt;br /&gt;
Thus, it is possible to look for deadlock patterns consisting of only a few boxes to check if a particular game situation is deadlocked, which is much easier than having to consider all boxes.&lt;br /&gt;
&lt;br /&gt;
This article describes some common types of deadlocks.&lt;br /&gt;
&lt;br /&gt;
The player is represented by an arrow, a box by a sphere, and a goal by a small hole.&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;&#039;Dead square deadlocks&#039;&#039;&#039; ==&lt;br /&gt;
&lt;br /&gt;
Dead square deadlocks are squares in a level that immediately create a deadlock situation when pushing a box to them.&lt;br /&gt;
See this example level:&lt;br /&gt;
&lt;br /&gt;
[[Image:simpleDeadlockExample.png]]&lt;br /&gt;
&lt;br /&gt;
The player can push the box to every direction. But pushing the box to a darker shaded square results in a deadlock. If the player pushed the box one square up, the box would still be pushable (to the left and right), but no matter what the player does, it won&#039;t be possible to push the box to the goal anymore.&lt;br /&gt;
This type of deadlock is &amp;quot;simple&amp;quot;, because it just needs one box to create it. Even if the level contained more boxes they all would be irrelevant regarding the deadlock situation. Furthermore simple deadlocks are static - that means the squares creating a simple deadlock are there at level start and during the whole game play. No matter how the boxes are pushed, a box on one of these squares will always result in a simple deadlock.&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;&#039;Freeze deadlocks&#039;&#039;&#039; ==&lt;br /&gt;
&lt;br /&gt;
Sometimes boxes become immoveable. If a box becomes immoveable while not being located on a goal the whole level is deadlocked. The box is &amp;quot;frozen&amp;quot; on that square and can never be pushed again!&lt;br /&gt;
&lt;br /&gt;
[[Image:FreezeDeadlockExample.png]]&lt;br /&gt;
&lt;br /&gt;
Pushing the box above the player one square up results in a freeze deadlock. The box becomes immoveable without being located on a goal =&amp;gt; deadlock. &lt;br /&gt;
Every time a box gets immoveable on a square that isn&#039;t a goal square this type of deadlock occurs. Note: It needn&#039;t to be the pushed box that isn&#039;t located on a goal:&amp;lt;br&amp;gt;&lt;br /&gt;
[[Image:FreezeDeadlockExample2.png]]&lt;br /&gt;
&lt;br /&gt;
Here a push to the left results in a freeze deadlock although the pushed box is located on a goal after the push. The push immobilizes another box which immobilizes, ... finally a box is immobilized which isn&#039;t located on a goal.&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;&#039;Corral deadlocks&#039;&#039;&#039; ==&lt;br /&gt;
&lt;br /&gt;
A corral is an area the player can&#039;t reach.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:CorralDeadlockExample.png]]&lt;br /&gt;
&lt;br /&gt;
The right area (marked with little blue quadrats) isn&#039;t reachable for the player. Pushing the lower box to the right results in a situation that is deadlock. Even both boxes are still pushable none of them can reach a goal anymore. Programs like [http://sourceforge.net/projects/sokobanyasc/ Sokoban YASC] can recognize some of these corral deadlocks by checking if a box can be pushed out of the corral area (that is the area marked by the blue quadrats) or all boxes can be pushed to goals.&lt;br /&gt;
Corral deadlocks can include all other type of deadlocks. In fact the corral area (the area the player can&#039;t reach) can be seen as an own little sublevel.&lt;br /&gt;
&lt;br /&gt;
[[Image:CorralDeadlockExample2.png]]&lt;br /&gt;
&lt;br /&gt;
In this level the player just has pushed the box one square down. This results in an area the player can&#039;t reach. Although it&#039;s possible to push one box out of the marked area this can only be done by creating another corral deadlock! Hence, the current situation is a deadlock.&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;&#039; Closed diagonal deadlocks &#039;&#039;&#039; ==&lt;br /&gt;
&lt;br /&gt;
Pushing the box to the left in this example level creates a &#039;closed diagonal deadlock&#039;:&lt;br /&gt;
&lt;br /&gt;
[[Image:closedDiagonalDeadlockExample.png]]&lt;br /&gt;
&lt;br /&gt;
This type of deadlock often occurs in &amp;quot;checkerboard levels&amp;quot; like [http://sokobano.de/results/display.php?set=sasquatch5&amp;amp;lvl=49 Sasquatch V-50].&lt;br /&gt;
The diagonal may also contain some walls like in this example level:&lt;br /&gt;
&lt;br /&gt;
[[Image:closedDiagonalDeadlockExample2.png]]&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;&#039; Bipartite deadlocks &#039;&#039;&#039; ==&lt;br /&gt;
I call this type &amp;quot;bipartite deadlocks&amp;quot; because of the algorithm needed to detect them.&lt;br /&gt;
Sometimes not every box can be pushed to every goal. Then it is important which box is pushed to which goal.&lt;br /&gt;
See this example:&lt;br /&gt;
&lt;br /&gt;
[[Image:BipartiteDeadlockExample.png]]&lt;br /&gt;
&lt;br /&gt;
Pushing the box to the right results in a bipartite deadlock. Although every box can be pushed to a goal after this push, it will be impossible to push all boxes to a goal at the same time.&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;&#039; Deadlocks due to frozen boxes &#039;&#039;&#039; ==&lt;br /&gt;
Frozen boxes don&#039;t create a Freeze deadlock when being located on a goal. Nevertheless they may influence the reachable area of other boxes.&lt;br /&gt;
&lt;br /&gt;
[[Image:FrozenBoxDeadlockExample.png]]&lt;br /&gt;
&lt;br /&gt;
Pushing the box next to the player to the right results in a deadlock because the box gets frozen and therefore the other box can&#039;t be pushed to a goal anymore.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
There are a lot more types of deadlocks in the game of Sokoban. Often deadlocks are a combination of more than one deadlock type. Detecting a deadlock is an important task for humans as well as for computers in order to be able to solve a level. Programs like [http://sourceforge.net/projects/sokobanyasc/ Sokoban YASC] can help the user to avoid some of the described deadlocks. However, most of the deadlocks remain undetected.&lt;/div&gt;</summary>
		<author><name>Sunshine</name></author>
	</entry>
</feed>