[Olena-patches] milena r1740: Dmap naive algorithm from Theo