KMZI algorithms