MILP formulations for highway petrol station replenishment in initiative distribution mode

To investigate highway petrol station replenishment in initiative distribution mode, this paper develops a mixed-integer linear programming (MILP) model with minimal operational costs that includes loading costs, unloading costs, transport costs and the costs caused by unpunctual distribution. Based on discrete representation, the working day is divided into equal time intervals, and the truck distribution process is decomposed into a pair of tasks including driving, standby, rest, loading and unloading. Each truck must execute one task during a single interval, and the currently executing task is closely related to the preceding and subsequent tasks. By accounting for predictive time-varying sales at petrol stations, real-time road congestion and a series of operational constraints, the proposed model produces the optimal truck dispatch, namely, a detailed task assignment for all trucks during each time interval. The model is tested on a real-world case of a replenishment system comprising eight highway petrol stations, one depot, one garage and eight trucks to demonstrate its applicability and accuracy.

v Oj,k,t The received volume of product k at node j from refineries during time interval (t, t + 1) (if node j is a depot), m 3 /h v Sj,k,t The sales rate of product k at node k during time interval (t, t + 1) (if node j is petrol station), m 3 /h v Pmaxj,k The maximum capacity of product k at node j (if node j is petrol station), m 3 t Rmax The maximal rest time, h t Rmin The minimal rest time, h t Smax The maximum standby time, h t Smin The minimum standby time, h Z t,j,j′ The congestion coefficient between node j and j′ during time interval (t, t + 1) Δτ The length of the time interval, h τm The length of the study horizon, h α k The coefficient for the transport costs of trucks with full of product k Binary parameters f Li,k The binary parameter indicating that truck i can load product k f PDj The binary parameter indicating that node j is a depot f PGj The binary parameter indicating that node j is the garage f PPj The binary parameter indicating that node j is a petrol station f PSj The binary parameter indicating that the standby task is permissible at node j Positive continuous variables C Ot,j,k The cost caused by the unpunctual distribution of node j 's product k at time node t, CNY C Tt,j,k The transport cost of truck i's task b, CNY T Ri,b The total rest time of truck i from the beginning of the study horizon to the start time of its task b, h V Pj,k,t The inventory of product k at node j at time node t (if node j is a petrol station), m 3 V Dj,k,t The inventory of product k at node j at time node t (if node j is a depot), m 3 Binary variables E BTi,b,t The binary variable indicating that truck i's task b starts at time node t E DVi,j,b,k,t The binary variable indicating that truck i's task b is loading product k to node j during time interval (t, t + 1) E DVBi,j,b,k,t The binary variable indicating that truck i's task b is to start loading product k from node j at time node t E DVNi,j,b,k,t The binary variable indicating that truck i's task b is to complete loading product k from node j at time node t E PVi,j,b,k,t The binary variable indicating that truck i's task b is to unload product k at node j and is finished at time node t N Ci,b,j The binary variable indicating that truck i is staying at node j when its task b starts P Li,b,k The binary variable indicating that truck i is filled with product k during its task b S Di,b The binary variable indicating that truck i's task b is to drive to another node S Li,b,k The binary variable indicating that truck i's task b is to load product k at the depot S Ri,b The binary variable indicating that truck i's task b is to rest at the garage S Si,b The binary variable indicating that truck i's task b is to standby S Ui,b The binary variable indicating that truck i's task b is to unload product at a petrol station 1 Introduction

Background
As necessary facilities for urban transportation, petrol stations play a critical role in the steady supply of refined products (Fernandes et al. 2013), and efficient distribution of refined products is also important in the smooth operation of cities. To daily replenish petrol stations, the transport company must simultaneously determine detailed routes and product assignments for each truck (Cattaruzza et al. 1 3 2014; Liu and Jiang 2012). As we know, product oil distribution between refineries and oil depots is usually carried by pipelines (Fernandes et al. 2013), and there are distribution stations along the pipelines. Researchers often focus on the formulation of scheduling plans (Zhang et al. 2016) and transmission plans (Fernandes et al. 2013). Zhang et al. (2017) established a MILP model to solve problems, and some researchers (Moradi et al. 2019) had also proposed efficient algorithm to solve scheduling studies. Liang et al. (2012) considered regional differences in electricity prices along the pipeline, established an optimization model for a multi-product pipeline which has a known delivery demand and operation plan for each off-take station. Different from the distribution between refineries and oil depots, the replenishment of petrol stations takes truck transportation as the mode of transportation, which is easier to be affected by the condition of road congestion. The replenishment of petrol stations is mainly classified into two types: passive distribution and initiative distribution. For passive distribution, petrol stations order products before the next working day, specifying the minimum and maximum quantity to be delivered for each ordered product. The minimum quantity is often determined by the stations' average daily sales, while the maximum quantity is determined by the difference between the capacity of the station's storage tanks and an estimation of the remaining stock before the next replenishment. Generally, petrol stations specify that products be replenished during periods when sales are low and not during peak periods. However, passive distribution has the following problems. First, the specified replenishment time of different petrol stations may be highly similar, so that trucks are extremely busy during these periods and idle when the petrol stations are busy and unable to replenish stock. Second, a single petrol station may receive a variety of products several times from transportation companies in a single day, and it is difficult to estimate and coordinate each distribution time. By contrast, with initiative distribution, petrol stations do not order products but instead forecast the sales for each station, while the transport company assigns the specific time to deliver the products. The advantage of initiative distribution is that it treats the whole replenishment process as an integrated system, and the replenishment time is determined by the system instead of the petrol stations. This approach allows the working time of trucks in a day to be more balanced, thereby avoiding the inefficiency created by concentrated periods of demand. Overall, initiative distribution improves efficiency in the dispatch of trucks and therefore in the running of the entire replenishment system.

Related work
One of the first articles addressing the issue of petrol station replenishment was published by Brown and Graves (1981).
They developed an integer programming model to address the problem of a nationwide bulk delivery fleet of petroleum tanker trucks. The objective function was to minimize transport costs under the constraints of equitable manpower and equipment workload distributions, safety, customer service, and equipment compatibility restrictions. The model was applied to a scale of more than 80 bulk terminals on a fleet exceeding 300 vehicles with approximately 2600 loads per day. Brown et al. (1987) extended the work of Brown and Graves (1981) for a real-time, transaction-driven information management system that could solve the problem for 120 bulk terminals and more than 430 vehicles. Apart from mathematical programming methods, heuristic algorithms (Azad et al. 2017;Kasivisvanathan et al. 2014;Nambirajan et al. 2016), intelligent optimization (Diaby et al. 2016;Marinakis et al. 2013;Soto et al. 2017) and hybrid algorithm (Alinaghian and Shokouhi 2018; Shi et al. 2017) had also been widely used in dealing with the scheduling optimization issue. For example, focusing on the truck assignment and routing problem of a Hong Kong petrol distribution company, Ng et al. (2008) proposed a decision support system that combines heuristic clustering and optimal routing to determine the optimal fleet assignment and routing. Multiple objective functions included the minimal number of used trucks, the minimal number of drops in each trip, the maximal profits in terms of total products delivered and the maximal utilization of resources. For the multi-depot petrol station replenishment problem, Cornillier et al. (2008) presented a heuristic that contained route construction and truck loading procedures, a route packing procedure and two procedures enabling the anticipation or the postponement of deliveries. Next, Cornillier et al. (2009) studied the filling station replenishment problem with time intervals (PSRPTW). The introduction of time intervals leads to a great increase in model scale and computational effort, so they proposed an MILP model and two heuristics for this problem to determine the quantity of each product to deliver, the assignment of products to truck compartments, delivery routes and schedules. In fact, petroleum products are stored in a number of different depots, and they are delivered to a set of petrol distribution stations. Each depot has its own fleet of heterogeneous and compartmented tanker trucks. Therefore, in their later work, Cornillier et al. (2012) developed a heuristic procedure to generate a restricted set of promising feasible trips beforehand for the multi-depot petrol station replenishment problem with time intervals (MPSRPTW). Wang et al. (2018) established a mixedinteger linear model and proposed an improved heuristics algorithm to solve the petrol truck scheduling problem which considered multi-path selection and congestion. Boctor et al. (2011) firstly introduced a generalized trip packing problem, in which trucks have different capacities and trip net revenues depend on the trucks used. Meanwhile, some 1 3 construction, improvement and neighborhood search solution heuristics are proposed to solve a real-life case.
In addition to petrol station replenishment issues, a large number of studies have also focused on the vehicle routing problem (VRP), which focuses on the use of efficient algorithms Goodson et al. 2012;Schyns 2015). Brandão and Mercer (1997) presented a novel tabu search heuristic algorithm to solve the multi-trip routing and scheduling problem (VRSP) with respect to constraints in which a vehicle can make more than one trip each day and the customers impose delivery time intervals. Based on the adaptive memory procedure, Olivera and Viera (2007)  This paper studies on highway petrol station replenishment in the initiative distribution mode. Different from classical petrol station VRP problem, highways have a large and various demand for refined products in this study, so a single petrol station on a highway may be replenished more than once during a working day. Moreover, highway petrol stations receive a variety of refined products transported from depots, and a reasonable replenishment time for each type of product is difficult to predict only considering each petrol station. In fact, the replenishment mode studied in previous relevant work belongs to the passive distribution type, in which the quantity and delivery timing of each product are given by petrol stations. Compared with initiative distribution, passive distribution is dominated by human factors and often results in impractical truck allocation and low distribution efficiency. With the increasing popularity of Internet technology, the shift from passive distribution to initiative distribution is a compelling trend among petroleum enterprises looking to accomplish the daily information-based management of oil resources. However, to the best of our knowledge, this paper is the first research work that addresses this replenishment problem in an initiative distribution mode rather than a passive distribution mode. None of the abovementioned papers have simultaneously determined the quantities, timing and replenishment object of each product to be delivered by each truck through a comprehensive consideration of time-varying sales at petrol stations, real-time road congestion and the state monitoring of all trucks.

Contributions of this work
• With a focus on highway petrol station replenishment in the initiative distribution mode, an MILP approach is proposed to provide a more reasonable schedule for trucks and improve efficiency for the entire replenishment system. • Various factors appearing in practice, such as time-varying sales, task time limitations, real-time road congestion, different unit transport costs under full-load or noload conditions, road capacity, the detailed operational mode (namely, loading, unloading, rest and standby) and operational limitations, are all taken into consideration. • The optimal distribution plan, including the quantities, specific time and replenishment object of each product to be delivered by each truck, is solved by the proposed model. • A real case study is given to demonstrate the practicality of this method.

Paper organization
The adopted methodology and details of the mathematical model are given in Sects. 2 and 3, respectively. Section 4 provides a real case study in China and demonstrates the model's practicability. Finally, conclusions are presented in Sect. 5. Figure 1 illustrates the highway petrol station replenishment system studied in this paper. There are three types of destinations, namely garages, depots and petrol stations. At the initial time of one working day, trucks departure from garages to depots and then cover refined products to the petrol stations which are short of oil. Considering the limited number of loading arms, an upper limit is set for the number of trucks that are loading simultaneously. Therefore, trucks need to wait when there is no free loading arm. Additionally, all trucks are stored in the garage at the end of the working day. Since the petrol stations are sparsely distributed along the highway, the distance between any petrol stations is rather long and an oil depot can serve only a small number of petrol stations. It usually takes a long time for a truck to complete a single delivery task, which brings higher-level demands for truck scheduling from oil tankers. Distributing trucks according to the reports from petrol stations may result in higher demand in some busy time periods and no demand in other times, thereby greatly reducing the efficiency of the dispatch system. In order to overcome the lack of passive distribution model stated above and provide a more reasonable schedule for trucks and reduce cost, this paper develops a discretetime MILP model in the initiative distribution mode and incorporates the constraint of sales predictions as an addition to other constraints. In the proposed model, the truck distribution process is decomposed into a pair of tasks, including driving, standby, rest, loading and unloading, and each task is closely related to the preceding and subsequent task. For any truck, a complete replenishment process involves driving to a depot, loading, driving to a petrol station and unloading. In practical engineering, a truck can replenish the oil supply of multiple petrol stations or of a single petrol station repeatedly for 1 day. Therefore, there are several tasks that must be completed at specified destinations for each truck. Moreover, the entire scheduling time horizon is divided into several equal time intervals, and each truck must execute one task during each interval.

Model requirements
The model is formulated as MILP, and MATLAB R2014a is employed to calculate the detailed truck routing and scheduling of petrol station replenishment. Given: • The time horizon of the working day. • The locations of garages, depots and petrol stations. • The delivery plan of the depot (delivery volume during each time interval) and the sales plan of the petrol stations (sales volume during each time interval). • The inventory of the depot and petrol stations for each product.
• The congestion condition during each time interval. • The basic information of trucks. Determine: • The detailed scheduling of trucks: the executed task during each time interval. • The departure point and the corresponding destination of each transport task. • The quantity and type of product being loaded (unloaded) of each load (unload) task. • The inventory variations of depots and petrol stations. • The total operational costs. Objective: The objective is to create a distribution plan with minimal operational costs while respecting a variety of operational and technical constraints. To establish and solve the model effectively, assumptions are made as follows.
• The trucks drive at a constant speed and can only load one type of specified product during each time interval. • After the truck arrives at the depot or petrol station, it needs time to load or unload the petrol products, and the speed of loading and unloading is constant. • During a single workday, all trucks start from the garage and return to the garage after completing all tasks. • Petroleum companies predict the daily sales plan of the petrol stations and a daily delivery plan for the depots beforehand. • The standby times and rest times of each vehicle during the working day should be within the allowed limits. • The transport time between any two destinations is closely related to their real distance and real-time congestion conditions.

Mathematical model
This paper develops the MILP model based on discrete representation (Shaik and Bhat 2014). The studied system is made up of a set of nodes j ∈ J, including depots (f PDj = 1), petrol stations (f PPj = 1) and garages (f PGj = 1). Time nodes t ∈ T is used to divide the working day into several equal time intervals, and the truck distribution process is decomposed into a pair of tasks. Each truck must execute one task during a single interval, and the currently executing task is closely related to the preceding and subsequent task. By accounting for predictive time-varying sales at petrol stations, real-time road congestion and a series of operational constraints, the proposed model produces the optimal truck dispatch, i.e., the detailed task assignment of all trucks during each time interval.
Overall, the model involves five sets: the set of trucks (I); the set of tasks (B i ); the set of nodes (J); the set of product types (K); and the set of time nodes (T) chronologically arranged. Moreover, this model comprises of positive continuous variables controlling the product inventory at petrol stations (V Pj,k,t ) and depots (V Dj,k,t ), the accumulated rest time of trucks (T Ri,b ), transport costs (C Ti,b ) and the costs for unpunctual distribution (C Ot,j,k ). Beyond that, a series of key binary variables are also introduced to identify if truck i are loading/unloading/resting/driving/standing by during its task b (in case S Li,b,k , and if truck i is staying at node j when its task b starts (in case N Ci,b,j = 1).

Objective function
The objective function is the minimum operational cost, including the loading operation cost ) and the cost caused by the late distribution for petrol sta-

Trucks' state constraints
This paper introduces binary variables to indicate the position of all trucks. N Ci,b,j equals 1 when truck i is located at node j at the start time of task b. During any task, a truck can only stay at one node.
There are two states for all trucks: one is full-load, and the other is no-load. If truck i is filled with product k at the start time of its task b, P Li,b,k = 1, and otherwise P Li,b,k = 0. In this way, ∑ k∈K P Li,b,k = 1 stands for full-load while ∑ k∈K P Li,b,k = 0 stands for no-load. Furthermore, the trucks are also divided into two types: one stores gasoline, and the other stores diesel oil. Equations (3) and (4) ensure that each truck only transports one type of specified oil during a single task. Note that the binary parameter f Li,k in Eq. (3) is used to indicate if truck i can load product k. (1) The executable operations of all trucks include load, unload, rest, drive and standby, only one of which can be executed during a single task:

Loading constraints
For any truck i, the loading operation can only be executed at depots. In other words, the binary variable of the loading operation (S Li,b,k ) can equal one when truck i is located at node j, with node j being a depot (i.e., N Ci,b,j = 1, f PDj = 1). Constraint (7) states that only no-load trucks can execute loading operations. If truck i loads product k during its task b, it will be filled with product k at the start time of its next task, that is to say, P Li,b+1,k would be one if S Li,b,k is equal to 1 [see constraint (8)]. Otherwise, the truck without product k will remain unchanged. As seen in constraint (9), if P Li,b,k is zero P Li,b+1,k must be zero.

Unloading constraints
For any truck i, the unloading operation can only be executed at a petrol station. Specifically, the binary variable of the unloading operation (S Ui,b ) equals one when truck i is located at node j, while node j is a petrol station. Constraint (11) states that only full-load trucks can execute the unloading operation. If truck i unloads oil during its task b, it will be empty at the start time of its next task, that is to say, ∑ k∈K P Li,b+1,k must be zero as long as S Ui,b is equal to one [see constraint (12)]. If it does not unload oil, the truck that is filled with product k will remain unchanged. As seen in constraint (13), if P Li,b,k is one P Li,b+1,k must be one.

Rest, standby and driving constraints
Only when the truck stops at the garage at the work start time can it rest. By constraint (14), S Ri,b can be one only when Due to safety concerns, full-load trucks cannot rest. This operation condition is enforced by constraint (15). The binary variable of rest operation (S Ri,b ) must be zeros if ∑ k∈K P Li,b,k = 1.
To ensure safety, trucks can only stand by at some particular nodes. By constraint (16), S Si,b can be one only when At the end of the weekday, all trucks must be at a rest station, and the last task must be rest, as seen in Eq. (17).
All trucks cannot standby twice continuously. In constraint (18), only one of two adjacent tasks b and b + 1 can be standby.
If truck i's position at the start time of task b is different from that at task b + 1, then we can conclude that truck i's task b is driving. As constraint (19) states, S Di,b is bounded by the maximum value of N Ci,b+1,j − N Ci,b,j .

Time constraints
To develop the constraints between time and tasks, this paper introduces a binary variable (E BTi,b,t ), which equals 1 when truck i's task b starts at time node t. By constraint (20), each task must start at one time node. Constraint (21) determines that no task start be earlier than the start time of the preceding task. Furthermore, the last task of any truck must start before the study horizon, which is stated in constraint (22).
If the truck is loading products during its task b (i.e., ∑ k∈K S Li,b,k = 1 ), the time consumed by this task is related to the truck's capacity and the loading flow rate. If the truck is not loading products, constraints (23)-(24) are redundant, and the interval duration can then match the value computed from the time constraints of another unload, rest, drive and standby.
Similarly, if truck i is unloading products during its task b (i.e., S Ui,b = 1), the time consumed by this task is related to the truck's capacity and unloading flowrate. Otherwise, constraints (25)-(26) are redundant and the interval duration is bounded by other operations.
If truck i is resting during its task b (i.e., S Ri,b = 1), the rest time of this truck should be equal to the accumulated rest time before task b plus the duration of task b [i.e., constraints (27)- (28)]. If not, the rest time of this truck should be equal to the accumulated rest time before task b [i.e., constraints (29)-(30)]. The total rest time of each truck should be limited to a range [i.e., constraint (31)].
If truck i is driving during its task b (i.e., S Di,b = 1), the time consumed must be related to the average of the driving distance, the speed of the truck and the coefficient of road congestion during this time period. Specifically, if truck i's task b is to move from node j to node j′ during time interval t (i.e., S Di,b , N Ci,b+1,j′ , N Ci,b+1,j = 1), inequation constraints (32)-(33) work as an equation constraint. By doing so, the transport time is equal to the driving distance between node j and node j′(l j,j′ ) being divided by the truck speed (r D ) and then being multiplied by the congestion coefficient during interval t(Z t,j,j′ ).
If truck i is standing by during its task b (i.e., S Si,b = 1), the standby time should not be too long. Constraints (34)-(35) impose the lower and upper bounds on the standby time.

Petrol station constraints
The binary variable E PVi,j,b,k,t denotes the completed status of replenishment and equals one when a full-load truck i finishes unloading product k to node j at time node t. By constraints (36)-(37), if any value of binary variables S Ui,b E BTi,b+1,t , N Ci,b+1,j and P Li,b,k is equal to zero, E PVi,j,b,k,t must be zero. Conversely, if these variables are all equal to one, E PVi,j,b,k,t must be one.
If ∑ i∈I ∑ b∈B i ∑ k∈K E PVi,j,b,k,t is more than one, the received volume of node j during time interval (t, t + 1) equals the sum of the capacities of the corresponding trucks. Otherwise, the received oil volume is zero. The inventory of node j equals the inventory at the last time node plus the received oil volume and minus the sales volume during the last time interval.
During any time interval t, the inventory of the petrol station should meet certain limits. To obtain a feasible solution when faced with stockouts caused by falling product prices, there is no lower limit for the inventory of the petrol station. However, this model has added the costs caused by unpunctual distribution into the objective function to ensure that each petrol station keeps a stock of petrol products.

Depot constraints
This paper introduces three types of binary variables to represent the start, finish and process of the loading operation. Specifically, E DVBi,j,b,k,t equals one when a no-load truck i starts loading product k from node j at time node t [i.e., constraints (40)-(41)], while E DVNi,j,b,k,t equals one when the truck has just finished loading oil [i.e., constraints (42)-(43)]. As constraint (44) shows, E DVi,j,b,k,t is bounded by E DVBi,j,b,k,t and E DVNi,j,b,k,t , and it equals one when truck i is loading product k from node j during time interval (t, t + 1).
Due to the limited number of loading arms, a depot can only permit a limited number of trucks to load oil during a single time interval. (38) ,k,t is more than one, the discharged volume of node j during time interval (t, t + 1) is equal to the aggregate capacities of the trucks that are loading. Otherwise, the discharged volume is zero. Hence, the inventory at node j is equal to the inventory of the last time node plus the received volume from refineries and minus the discharged oil volume during the last time interval.
During any time interval t, the inventory of all depots should meet certain limits.

Cost constraints
For a given transport route, fuel consumption increases with the load. Hence, the transport costs are calculated by transportation distance and truck status, as shown in constraints (48)-(49). More specifically, transport costs for all empty trucks only depend on the product of unit cost and transportation distance. However, if truck i is full of product k, the transport costs must be a bitter higher than the costs of empty trucks. Therefore, the parameter α k in constraints (48)-(49) is used to compute the extra costs for carrying v NUi m 3 of product k.
It is forbidden for the truck to be delivering oil if its location remains unchanged. If this occurs, then the corresponding costs are at the maximum level. By constraint (50), transport costs ( C T i,b ) would be greater than a sufficiently large value (1/2M) when binary variables S Di,b , N Ci,b+1,j , N Ci,b,j are all equal to one.
As for any petrol station, a negative inventory stands for unpunctual distribution, which leads to economic losses. The right term of constraint (51) is a positive value when the inventory V Pj,k,t is negative, and thus imposes a lower bound for the costs of unpunctual distribution C Ot,j,k .

Basic data
This section is to validate our model and the superiority of initiative distribution by using a real-world case of a highway in Beijing, China. Figure 2 illustrates a real-world block where there are eight petrol stations (S1, S2, S3, S4, S5, S6, S7 and S8), a garage and a depot. The depot is located at the center of the block and is responsible for the product supplies of these petrol stations. A daily distribution plan starts at 6:00 and finishes at 24:00. During the workday, all trucks start from the garage and return to the garage after completing all tasks. For this replenishment system, there are a total of eight available trucks (C1, C2, C3, C4, C5, C6, C7 and C8) to transport three types of products (P1, P2 and P3). To avoid contamination, C1, C2 and C3 can only load P1, while C4, C5, C6, C7 and C8 (51) are usable for P2 and P3. However, each truck can only load one type of product at a time. The oil tank capacity of each truck is 20 m 3 , and the inventory of the petrol station is 30 m 3 . There are 2, 1 and 1 loading arms for P1, P2 and P3 in the depot, respectively. The unit labor cost and wastage cost of loading or unloading oil each time is 50 CNY, and the unit cost caused by unpunctual distribution is 600 CNY/(m 3 h) During the transport task, the unit transport cost for an empty truck is 10.9 CNY per kilometer, while it is 16.7 CNY per kilometer for a full-load truck. The trucks' speeds when loading, unloading and driving are 60 m 3 /h, 60 m 3 /h and 60 km/h, respectively. And the replenishment speeds of P1, P2 and P3 of the depot are 71.67 m 3 /h, 56.67 m 3 /h and 60 m 3 /h, respectively. Within the study horizon of the study, the sales rate of petrol station will change several times and is shown in Fig. 3. Standby time should be less than 1.5 h, while the total rest time for each driver should be less than 3 h.

Real-world scheduling plan
To demonstrate our advantages in the following part, we first give an overview of the actual scheduling plan premade by the company, which can be seen as a classic example of passive distribution. All the petrol station only puts forward the ordered products capacity and has no specific requirements on the delivery time. It only requires the products  Figure 4 shows the detailed distribution plan. Green represents the transportation task, yellow represents the standby task, orange represents the loading task, gray represents the rest task and blue represents the unloading task. The orange mark represents the type of product that needs to be loaded and unloaded, and the blue mark represents the petrol station that needs to be replenished. One complete replenishment plan for a truck, including the loaded product type and the replenishing object, is closely associated with the current inventory of all petrol stations, one complete replenishment plan for a truck, including the loaded product type and the replenishing object. At the start time, all trucks go from the garage to the depot and then perform the loading operation under the constraints of the number of loading arms and the demanded oil types. Afterward, each truck drives to the petrol station to unload oil and finally back to the garage to rest. Overall, C2 and C5 replenish petrol stations four times a day, and the others replenish petrol stations three times a day. Figures 5 and 6 depict the inventory variation of petrol stations and depots. It can be seen from Fig. 8 that sometimes oil shortage occurs in a few petrol stations. Specifically, P1 is out of stock in S1 at 20:40, P2 is out of stock in S2 at 16:00, P2 is out of stock in S5 at 18:30, and P3 is out of stock in S8 at 13:40. The stock out of S2 is the most severe and lasts almost 3 h.

Optimal scheduling plan
To obtain the optimal scheduling plan of initiative distribution, we develop a mathematical model according to Sect. 3. The model is solved by the Gurobi Optimizer under the hardware environment of the Intel Core i7-4770k (3.50 GHz). The Gurobi Optimizer is a state-of-the-art mathematical programming solver able to handle all large-scale problem types. This solver was designed from the ground up to exploit modern architectures and multicore processors by using the latest implementations of the latest algorithms. Furthermore, the solver supports matrix-oriented interfaces for MATLAB. Given the same MILP model, Gurobi can solve it faster and use less memory than the nested solver of MATLAB. The optimal distribution plan of trucks is shown in Fig. 7. Its total cost during the research time horizon is 79,254 CNY, including 2600 CNY for loading and unloading operations and 76,654 CNY for transportation. Each petrol station is replenished before its inventory is low; thus, there is no cost caused by unpunctual distribution. In contrast to the real-world result, the cost of transportation and out of stock is greatly saved.
As is known from Fig. 7, C2 and C6 replenish petrol stations four times a day, while the others replenish petrol stations three times a day. The loading order depends on the loading arm constraint and the truck's destination. Taking the 7th and 8th time intervals (i.e., 7:10-7:30) as an example, all trucks except C6 arrive at the depot, while only C2, C3, C4 and C5 are loaded because there are 2, 1 and 1 loading arms for P1, P2 and P3 in the depot, respectively. Moreover, there are three trucks that need to load P3 during the first loading operation, but the loading order is C4 (replenish for S2), C7 (replenish for S6) and C8 (replenish for S5). From Fig. 5, it can be seen that the first station to reach the lower limitation is S2, followed by S5 and S6. Considering that the transportation distance of S6 is longer than that of S5, C7 loads P3 ahead of C8. With a comprehensive consideration of the transportation time and out-of-stock time, initiative distribution is able to optimize the delivery sequence for all petrol stations. After the optimization, the time to replenish  Fig. 4 Detailed distribution plan of passive distribution P1 at S1, P2 at S2, P2 at S5 and P3 at S8 is brought forward to 20:00, 13:10, 18:10 and 13:10, thus avoiding the out of stock occurred under the mode of passive distribution.
Besides, most trucks' final task is to replenish the petrol stations that are relatively close to the garage, such as S1 and S4, and then to return back to the garage to rest after   completing the loading task. From Fig. 7, C1 and C3 are the first trucks to arrive at the garage (at 21:00), and they have a 3-h rest time. Figure 8 illustrates that all the petrol stations would receive timely replenishments when their inventories are close to their lower limits, and the inventory during the study horizon stays within the allowable range. This also indicates that initiative distribution enables petrol stations to control their inventory at a relatively low but safe level and gives a potential advantage of reducing inventory handling cost when compared to passive distribution. The inventory variation of the depot is depicted in Fig. 9 and meets the capacity constraints during the entire study horizon.

Conclusions
In order to improve efficiency for the entire replenishment system of highway petrol stations, this paper establishes a MILP model which sets the minimum operating cost as the objective function and considers the detailed truck status and a series of operational constraints. In the cost component, loading and unloading operating cost, transportation cost and cost caused by out of stock are taken into account. One step further than previous studies is that the proposed model is capable of dealing with a variety of products, time-varying sales rates and congestion conditions. For a real-world case containing eight petrol stations, one depot with three types of oil products and one garage with eight trucks, the detailed truck dispatch plan is optimized using this model. During the 18 h of the study period, the sales rate of each petrol station varies several times and every truck has a detailed task assignment in each time interval. And it also visualizes the inventory change of each petrol station and depot. Compared to the actual scheduling plan in passive mode premade by the company, initiative mode leads to less operational cost while controlling the inventory of all the petrol stations at low but safe level. In the initiative mode, inventory is predicted scientifically and the products are sent to the petrol station in a suitable time, which effectively improves the efficiency of product oil resource allocation and enhances the stability of the supply of petrol station. However, the truck scheduling problem is an NP-hard problem with strict demands on computational time and space. For a mathematical model, it is suitable for obtaining the optimal solution for a relatively small problem because the solving efficiency is closely related to the model's scale. Therefore, developing a highly efficient meta-heuristic algorithm to solve increasingly complex truck scheduling problems within an acceptable time is important for future works. S6 S1 S1 S1 S1 S2  Open Access This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the article's Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article's Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http://creat iveco mmons .org/licen ses/by/4.0/.