DilMil algorithm