Cube placement optimization