|
@@ -1016,15 +1016,15 @@ rest of the integers corresponding to stack locations.
|
|
|
\centering
|
|
|
\begin{lstlisting}[basicstyle=\rmfamily,deletekeywords={for,from,with,is,not,in,find},morekeywords={while},columns=fullflexible]
|
|
|
Algorithm: DSATUR
|
|
|
-Input: the inference graph @$G$@
|
|
|
-Output: an assignment @$\mathrm{color}(v)$@ for each node @$v \in G$@
|
|
|
+Input: a graph @$G$@
|
|
|
+Output: an assignment @$\mathrm{color}[v]$@ for each node @$v \in G$@
|
|
|
|
|
|
@$W \gets \mathit{vertices}(G)$@
|
|
|
while @$W \neq \emptyset$@ do
|
|
|
pick a node @$u$@ from @$W$@ with the highest saturation,
|
|
|
breaking ties randomly
|
|
|
- find the lowest color @$c$@ that is not in @$\{ \mathrm{color}(v) \;|\; v \in \mathrm{Adj}(v)\}$@
|
|
|
- @$\mathrm{color}(u) = c$@
|
|
|
+ find the lowest color @$c$@ that is not in @$\{ \mathrm{color}[v] \;|\; v \in \mathrm{Adj}(v)\}$@
|
|
|
+ @$\mathrm{color}[u] \gets c$@
|
|
|
@$W \gets W - \{u\}$@
|
|
|
\end{lstlisting}
|
|
|
\caption{Saturation-based greedy graph coloring algorithm.}
|