SPIMI algorithm, version 1