refactor: change allocate-machines to return the first solution