This paper makes an attempt to formulate a model for solving the empty-container allocation problem in the shipping company by the mathematic programming method. Those models proposed in the past papers took five characteristics into account, including the container size (20', 40'), the ownership (owned, leased), the supply and demand of empty-container ( both eastbound voyage and westbound voyage), the returned empty-container from importers, the option to discharging port of empty-containers. This model proposed in this paper takes seven characteristics into account, including the above-mentioned five characteristics, the empty-container safety inventory and the maximum inventory at each port. Finally this model is tested by a case and the sensitivity test results show that (1) the optimal empty-container volume in each port is 95 containers. Thus this paper suggests the shipping companies should increase the empty-container volume in every port to reduce the total container allocation costs. (2) The empty- container rent charge for every day is an influential factor for the total container allocation costs. The results show that the empty-container allocation model proposed in this paper could be a reference for carriers to save the operation costs in the actual empty-container allocation.