# Operation Optimization of the Sea Container Fleet Based on the Double-Level Planning Model
## 2 The Establishment of the Model
### Model Solution  
The model introduced in this paper exhibits nonlinear mixed integer programming features, encompassing both integer variables (the allocation of ships to routes) and continuous variables (navigation speed). Notably, Equation (8) and constraints 3 and 4 are nonlinear expressions, with constraint 3 requiring rounding up. In practical applications, ship enterprises often face constraints on their number of intercontinental mainline routes and ship type selection. Based on this, this paper suggests a step-by-step approximation algorithm [19] combined with the enumeration strategy to address the challenges encountered during model construction.  
The specific process includes the following:  
1. The routes and vessel types should be numbered sequentially, and the enumerative method should be used to find all the permutations of \(R\) routes based on their serial numbers (\(R!=R\bullet(R-1)\bullet\ldots\bullet 1\))). Beginning with permutation 1, for each permutation \(j(j\in R!)\), all the routes should be equipped with vessels in the order of route numbers and in the order of vessel type numbers.
2. In the selected sequential order of arrangement \(a\), the sequentially selected \(V\)-shaped ships are configured based on the sequentially selected \(r\) route. Starting from the maximum speed \(S_{\max},v\), let \(S_{v}=S_{\max}\), and use constraint 3 to calculate the number of \(V\)-shaped ships required on the route, \(n_{m,qr}\). According to constraint 1, it is judged whether the configuration of \(V\)-shaped ships on this route can meet the weekly freight capacity. If it is not satisfied, proceed to step 5; if it is satisfied, use \((P_{1}F_{1,vp}+7P_{f,v})\) to obtain the total cost of this route \(c_{m,r}\), and note \(c_{a^{*},r}=c_{m,r}\), \(s_{a^{*},r}=s_{v},n_{a^{*},qr}=n_{m,qr}\).
3. Let \(s_{v}=s_{v}-0.1\); use constraint condition 3 to calculate the quantity \(n_{m,vr}\) of this type of ship required on the route, and use Equation (6) to calculate the total cost \(C_{e,r}\) of the route. If \(c_{e,r}<c_{j_{*},r}\), then let \(c_{a^{*},r}=c_{e,r},s_{a^{*},p}=s_{v},n_{a^{*},qr}=n_{m,qr}\). Repeat this step until \(s_{v}=S_{\min,v}\).
4. According to step 2, the ships of the following route in the arrangement are allocated. If the preceding route has been allocated with type \((v+1)\) ships, the allocation continues on this route until all routes in the arrangement are completed. At this time, the total operation cost of the ships on each route \(r\) in arrangement \(a\) is \(c_{a^{*},r}\), and the speed of ship type \(v\) is \(s_{a^{*},v}\). Let \(Z_{a^{*}}=\sum\limits_{r\in R}c_{a^{*},r}\), and proceed to step 6.
5. Renumber ship types \(v+1,\ldots,V\) as \(v,\ldots,V-1\), Re-number \(v\) as \(V\) and move to step 2.
6. Let \(a=a+1\). If \(a\leq R!\), then proceed to step 2; otherwise, record \(a^{*}=a_{0}|_{z_{v_{0}}=\min\{Z_{a^{*},v\in R}\}}\). \(a^{*}\) is the optimal permutation, and its corresponding ship speed is the optimal speed. The route ship allocation scheme is the optimal scheme. Thus, the algorithm ends.