A minimum cost design for an automated warehouse