A Mathematical Model and a Heuristic Algorithm for Berth Planning