LOCs lattice OF cuboids formation and local-minima path finding with linear space and time complexities.