Primitive sickly version of the graph algorithm.