A novel approach to the optimization of refining Schedules for crude oil operations in refinery

—Short-term scheduling for crude oil operations is a combinatorial problem and involves extreme detail. Thus, it is very complicated and, up to now, there is no efﬁcient technique and software tool for it. To search for efﬁcient techniques, a two-layer hierarchical solution is proposed for it. At the upper level, one ﬁnds a realizable reﬁning schedule to optimize some objectives. At the lower level, a detailed schedule is obtained to realize it. A methodology has been presented to solve the lower level problem from a control perspective by the authors of this paper. In this paper, the upper level problem for ﬁnding optimal reﬁning schedules is addressed, and a novel method is proposed based on the results obtained at the lower level. This method solves a linear programming problem to determine the maximal production rate and a transportation problem to optimally assign crude oil types and volume to the distillers. This way, the method is computationally very efﬁcient. An industrial case study is presented to show the application of the proposed method.

A Novel Approach to Optimization of Refining Schedules for Crude Oil Operations in Refinery NaiQi Wu, Senior Member, IEEE, Liping Bai, MengChu Zhou, Fellow, IEEE, Feng Chu, Senior Member, IEEE,andSaïd Mammar, Senior Member, IEEE Abstract-Short-term scheduling for crude oil operations is a combinatorial problem and involves extreme detail.Thus, it is very complicated and, up to now, there is no efficient technique and software tool for it.To search for efficient techniques, a twolayer hierarchical solution is proposed for it.At the upper level, one finds a realizable refining schedule to optimize some objectives.At the lower level, a detailed schedule is obtained to realize it.A methodology has been presented to solve the lower level problem from a control perspective by the authors of this paper.In this paper, the upper level problem for finding optimal refining schedules is addressed, and a novel method is proposed based on the results obtained at the lower level.This method solves a linear programming problem to determine the maximal production rate and a transportation problem to optimally assign crude oil types and volume to the distillers.This way, the method is computationally very efficient.An industrial case study is presented to show the application of the proposed method.
Index Terms-Crude oil operations, linear programming, shortterm scheduling, transportation problem.

I. INTRODUCTION
I N recent years, aiming at profit increase, great attention has been paid to the development of effective techniques for the operations of refinery [16].There are three levels in operating a plant of refinery: production planning, production scheduling, and process control.Up to now, at the process control level, advanced control systems have been installed for unit control to optimize some production objectives in most oil refineries, resulting in significant productivity gains in the unit level.However, the optimized production units do not imply the global economic optimization of a plant.At the planning level, with the availability of linear-programming-based commercial software for refinery production planning, such as process industry modeling system [1], general production plans of a whole refinery can be found.As pointed out by Pelham and Pharris [17], the planning technology can be considered well developed and not much progress should be expected.Short-term scheduling is at the middle level and it lacks effective techniques and software tools.The three levels should work together to effectively operate a process plant [26].Thus, with the well-developed techniques for planning and process control, it is crucial to develop effective techniques for short-term scheduling [3], [4].
To search for effective techniques for short-term scheduling, in recent years, effort has been made and mathematical programming models are developed for batch processes.For examples, models in [6], [7], [13], [14], and [18] are representative.These techniques are then modified to solve short-term scheduling problem in refinery.Depending on the time representation, there are mainly two categories of mathematical programming models: discrete-and continuous-time representation ones.The former divides the scheduling horizon into a number of time intervals with uniform time durations.An event, such as start and end of an operation, should happen at the boundary of a time interval.The mixed integer programming models [5], [8], [11], [15], [19], [21], [23], [24] are the representative ones.The main drawback is that the uniform time interval must be small enough so as to obtain acceptable accuracy, which leads to a huge number of binary variables and makes the problem very difficult to solve [2], [33].Continuous-time models are adopted in [8]- [10], [25] to reduce the number of discrete variables.Although the number of discrete variables is significantly reduced, the drawback is that there are nonlinear constraints in it [19].Furthermore, to build such a model, it needs to know the number of events to occur [2].In fact, it is not known before the schedule is created.Moreover, to make the problem solvable, most of discrete-time and continuous-time mathematical programming models make special assumptions, which, unfortunately, make a low-quality or unrealistic solution for real-world cases [15].
For complex scheduling problems, application of heuristics and search algorithms, such as simulated annealing algorithms, genetic algorithms, and tabu algorithms [12], [20], [22], [34], is a good choice.These techniques are applicable only for problems where the jobs that are to be scheduled are deterministic at the beginning and solution feasibility is not a problem.However, to generate a short-term schedule for a refinery process, one needs to set the number of jobs, define the detailed activities for each job and the time needed for each activity, and determine their sequence.Meanwhile, there is no simple way to check the feasibility of a schedule.In other words, these techniques are not applicable to short-term scheduling of refinery.Thus, a new method should be developed to solve this problem.
Short-term scheduling for crude oil operations is one of the most difficult scheduling problems in operating an oil refinery plant.To solve this problem, the short-term scheduling for crude oil operations is divided into two subproblems in a hierarchical way in [28].At the upper level, one needs to find a refining schedule by optimizing certain objectives, while, at the lower level, a detailed schedule is created for a given refining one.With this decomposition and a Petri net model [28]- [31], [35]- [40] a heuristic is proposed to check the realizability for a given refining schedule in [28].If realizable, a detailed schedule is created.Nevertheless, by that method, if a detailed schedule is not found, it cannot answer whether the refining schedule is realizable or not.Furthermore, in [28], no method is presented for how a realizable refining schedule can be efficiently found.
A schedule should satisfy all the constraints.If so, it is a feasible schedule, and otherwise, it is infeasible one.The shortterm scheduling problem for crude oil operations is studied in a control perspective in [29]- [33].It is found that a short-term schedule is composed of a series of operation decisions (OD).The execution of an OD transfers the system from a state to another.A state is called safe, if starting with this state, there exists a feasible schedule, and otherwise, it is unsafe.Thus, for a feasible schedule, each OD should transfer the system from a safe state to another safe one.If a system is schedulable, initially, it must be at a safe state.To analyze the schedulability of crude oil operations, an architecture as shown in Fig. 1 is proposed.The crude oil operation process contains both discrete event and continuous variables; hence, it is a hybrid process.Based on the proposed architecture, hybrid Petri net models are developed to describe this process in [29]- [33].With these models, schedulabilty analysis is made and schedulabilty conditions are presented for different situations.These conditions can be used to check the realizability of a given refining schedule.If schedulable, a detailed schedule can be easily found.These conditions can also be used as constraints to obtain a realizable and optimal refining schedule.However, no method is presented for how to find such a refining schedule in [29]- [33].If such a refining schedule can be found in an efficient way, the shortterm scheduling problem for crude oil operations can be solved.Based on the schedulabilty conditions, this paper addresses the refining scheduling problem and presents an efficient approach to find a realizable and optimal refining schedule.It is a threephase approach.In phase 1, a linear programming model is built and solved to maximize productivity; in phase 2, a transportation problem is solved to assign crude oil to distillers; and then, in phase 3, the parcels of different crude oil types are sequenced to minimize the number of switching times.This way, a realizable and optimal refining schedule can be easily obtained.By this approach, the following contributions are made: 1) the hybrid optimization problem is decomposed such that each subproblem has only continuous or discrete event variables; 2) in phases 1 and 2, the subproblems are linear programming and transportation problem, respectively, which can be solved very efficiently, and it shows that the problem in phase 3 can be solved by a polynomial algorithm.Thus, the approach is computationally efficient; and 3) multiple objectives are handled effectively.
The remainder of this paper is organized as follows.In Section II, the process of crude oil operations is briefly introduced and statement of a refining scheduling problem is made.Then, the scheduling approach is presented in Section III.Section IV uses an industrial case problem to show the application and efficiency of the proposed approach.Conclusions are given in Section V.

II. CRUDE OIL OPERATIONS AND REFINING SCHEDULE
Before presenting our approach, this section briefly introduces crude oil operations in refinery and defines its refining scheduling problem.

A. Process
A general refinery process is illustrated in Fig. 2. It can be divided into three phases: 1) crude oil operations; 2) production; and 3) final product delivery.Crude oil is carried to the port by crude oil tankers and then unloaded into storage tanks by the port.The crude oil in the storage tanks is transported to charging tanks in the refinery plant through a pipeline.From the charging tanks, oil is fed into distillers for distillation.This process forms the crude oil operations.The middle products from the distillers are then sent to other production units for fractionation and reaction, which is the second phase.The products after fractionation and reaction are blended to produce the final products.As for short-term scheduling in a refinery, the scheduling problem of crude oil operations is one of the most difficult parts.
There are various types of crude oil processed in a refinery.The components are different given different types of crude oil.Each distiller can process parts of the crude oil types, but not all.Although a type of crude oil may be processed by multiple ones, the effectiveness is different for different ones.One can rank their effectiveness to process a crude oil type.
Because different types of crude oil should be processed by different distiller, a tank (storage or charging tank) can hold one type of crude oil at a time.Thus, crude oil can be unloaded into only an empty storage tank unless the same type of crude oil is in it.Similarly, crude oil in a storage tank can be transported via a pipeline into an empty charging tank or a charging tank with same type of oil in it.After filling a storage or charging tank, crude oil must stay in it for a certain amount of time before it can be discharged.This time delay is called oil residency time.Besides, a tank cannot receive and send oil at the same time for both storage and charging tanks.
Usually, a pipeline takes tens of kilometers long with the capacity of tens of thousand cubic meters.It is full of crude oil all the time and cannot be emptied.Because all types of crude oil are transported from storage tanks to charging tanks via a pipeline, there may be a number of segments of crude oil in the pipeline with different types of oil for different segments.
When crude oil in storage tanks is transported through a pipeline to charging tanks, different types of crude oil may be mixed to obtain suitable components for distillation with the oil transportation.However, we do not consider the mixing here for a mixture can be treated just as a type of crude oil.When a charging tank is feeding a volume ξ of crude oil into a distiller in time interval [τ 1 , τ 2 ] this tank must be dedicated to the distiller and cannot be charged during the time interval.Crude oil can also be mixed when it is fed into distillers.However, by doing so, two or more charging tanks should be used to serve one distiller at the same time.This way, a large number of charging tanks are required for distiller feeding.Hence, such an operational way is not considered because of the limited number of charging tanks.Thus, only one tank is needed to feed one distiller at a time unless it switches from one charging tank to another tank for feeding a distiller.
In feeding a distiller, there is a charging-tank-switch-overlap constraint explained as follows.Assume that charging tank CTK 1 is feeding distiller DS 1 and the oil in CTK 1 will be used up at time τ if the distiller is fed by just CTK 1 .However, the refining process requires that the successor tank CTK 2 ready to feed DS 1 should start working at time τ 1 , i.e., before τ .Thus, in time interval [τ 1 , τ 2 ] with τ 1 <τ <τ 2 , both CTK 1 and CTK 2 are feeding distiller DS 1 .During this time, the remaining oil in charging tank CTK 1 is used up, as well as a certain amount of crude oil in CTK 2 is fed into distiller DS 1 .T h i s is called charging-tank-switch-overlap constraint in distiller feeding.
In summary, the process includes the following resource and process constraints.The former include: 1) the limited number of storage and charging tanks and the capacity of each tank; 2) the limited flow rate of oil unloading and pipeline; and 3) the volume of various crude oil types available in storage and charging tanks, and in coming tankers.The latter include: 1) a distiller should be kept in working all the time uninterruptedly with upper and lower bounds of its production rate; 2) a type of crude oil should be processed by suitable distillers; 3) at least one charging tank should be dedicated to a distiller at any time for feeding it; 4) a tank cannot be charged and discharged simultaneously; 5) oil residency time constraint must be met; and 6) charging-tank-switch-overlap constraint.

B. Refining Scheduling Problem
Let Γ=[τ s , τ e ] denote the scheduling horizon that often lasts for a week or ten days with τ s and τ e being the start and end time points.A short-term schedule for crude oil operations should provide all the activities in every detail.For general scheduling problems, there are a set of jobs and a number of servers.The jobs are well defined, or they are often assumed to consume deterministic processing time.The scheduling problem is to assign the jobs to servers and determine the processing sequence for each server.For refining scheduling, the servers are the set of distillers in a refinery plant.However, the jobs that are to be scheduled are not known before a schedule is obtained.All the information that we know is the scheduling horizon Γ=[τ s , τ e ] and the initial state of the process at τ s .The initial state is characterized by the following.
1) The production state.For a distiller i,itgives: a) the type of crude oil being processed by distiller i; b) the production rate with which crude oil is being processed by distiller i; c) the charging tank that is feeding distiller i.
2) The state of tanks.A storage or charging tank must be in one of the four states: a) idle and empty; b) idle with oil in it; c) in charging; and d) in discharging: i) for State b, one has the information of the crude oil type and amount in it; ii) for State c, the crude oil type that is being charged, the charging rate, and amount of oil in the tank at the moment are given; iii) for State d, the crude oil type and amount remained in the tank and the discharging rate are given.3) The state of a pipeline.A pipeline must be in one of the states: a) idle; and b) transporting crude oil from storage tanks to charging tanks: i) for both states a and b, one has the number of different segments of crude oil in the pipeline, the crude oil type and amount for each segment at the moment; ii) for State b, one has the rate with which crude oil is being transported.4) The information of tanker arrivals.It includes the number of ships that will arrive during the scheduling horizon, and for each ship, one has a) arrival time; b) the types of crude oil in the ship and the amount of oil for each type; and c) the oil unloading rate.With the initial state for a process, a refining schedule is to determine, at any time point for the entire scheduling horizon, the production rate and the type of crude oil to be processed for every distiller in the system.In a refinery, processing different types of crude oil produces different products.To meet the market demands, various types of crude oil should be processed.Thus, for a distiller, it needs to switch from processing one type of crude oil to another type.Thus, the main decision for a refining scheduling is when such switches take place and the types of crude oil for each switch.To describe a refining schedule, we define a feeding parcel of crude oil (FPCO).
Definition 2.1: ) is defined as an FPCO, where COT = crude oil type to be fed into a distiller; ζ = volume of crude oil to be fed into a distiller; and [α, β]isa time interval in which α and β are the start and end time points for feeding this parcel of crude oil.
The flow rate for feeding such a parcel of oil during [α, β] can vary.However, when it changes, the set point for the distillation process should change as well, which leads to some loss.Thus, in practice, the flow rate for an FPCO is set to be a constant and can be calculated by f = ς/(β − α).Thereafter, if the same type of crude oil is fed into a distiller with different flow rate, we can simply treat it as a different FPCO.
) denote the jth FPCO for feeding distiller i. Assume that it needs Q FPCOs for distiller i during the scheduling horizon.Then, its refining schedule for distiller i can be denoted as RS i = {FPCO i 1 , FPCO i 2 , ..., FPCO iQ }.Furthermore, assume that there are K distillers in the system and let DS = {1, 2, ..., K} be the set of distillers and Then, the refining scheduling problem is to find an ordered set of FPCOs RS = {RS 1 ,RS 2 , ...,RS K } such that the following conditions are satisfied: where F i (MIN) and F i (MAX) are the allowable minimal and maximal flow rate for feeding distiller i.An illustrative refining schedule is shown in Fig. 3, where there are three distillers and two FPCOs for each distiller with a ten-day scheduling horizon.
Feasibility is essential for scheduling the crude oil operations.It requires that a refining schedule must be realizable by a detailed schedule.It should be pointed out that conditions (2.1) and (2.2) are not enough to guarantee the feasibility of a refining schedule RS.An oil refining process is a continuous process and it has an operation requirement as follows.If, at the initial state, charging tank A is feeding distiller DS 1 with a type of crude oil #k, a refining process starting from time τ s should be scheduled such that distiller DS 1 should continue to refine crude oil #k in charging tank A until tank A is emptied.If a refining schedule can meet this requirement, it is said that such a refining schedule is compatible with the initial state.Hence, the feasibility of a refining schedule is defined as follows.
Definition 2.2: A refining schedule for crude oil operations in a refinery is said to be feasible if 1) it is compatible with the initial state and 2) there exists a detailed schedule that implements it such that all the constraints given in the previous section are satisfied.In [29]- [31], schedulability conditions are presented.With these conditions as constraints, a realizable refining schedule can be found, but it does not know how such a schedule can be found.Up to now, we have described the refining problem.Based on the problem statement, an efficient scheduling approach will be presented in the next section.

III. SCHEDULING METHOD
With the description of refining scheduling in the previous section, this section presents an efficient scheduling approach.

A. Analysis of Refining Scheduling
Some objectives should be optimized when the crude oil operations are scheduled.Thus, we need to determine the objectives first.In the literature, the objectives include: 1) minimization of crude oil inventory cost, tanker waiting cost, and crude oil unloading cost [8], [9], [11]; 2) maximization of production and minimization of the number of tanks used [19]; 3) minimization of changeover cost [11]; and 4) minimization of heels [24].Among them, the minimization of crude oil inventory and changeover costs, and the maximization of production are related to the refining scheduling, while the others should be pursued at the detailed scheduling level.Note that for refining scheduling, the amount of crude oil available at the beginning of the scheduling horizon and the amount of crude oil that will arrive during the scheduling horizon are independent of the scheduling.Thus, with the initial crude oil inventory and oil arrival information, if the crude oil operations are scheduled such that the production rate is maximized, the crude oil inventory during the scheduling horizon must be minimized.Hence, maximizing the production rate minimizes the crude oil inventory cost at the same time.Besides maximization of production rate and minimization of crude oil inventory, the cost caused by assigning crude oil types to distillers should be minimized when crude oil operations are scheduled.As stated in the previous section, although a type of crude oil can be processed by a number of distillers, the effectiveness is different when it is processed by different distillers.Therefore, it needs to assign crude oil types to appropriate distillers for processing.In this paper, the goal is to find a refining schedule such that production is maximized, and changeover and crude oil type assignment costs are minimized.
As defined in Definition 2.2, to make a refining schedule realizable, schedulability conditions must be satisfied.Such conditions should be taken as constraints in finding a refining schedule.Thus, before developing the approach, we first present the schedulability conditions as follows.Let Ψ denote the oil residency time, f dsi the feeding rate to distiller i, and F p max the maximal flow rate of the pipeline.We have the following schedulability conditions without considering the chargingtank-switch-overlap constraint.
Lemma 3.1 [31]: Assume that: 1) the feeding rate for the the other tanks are empty, and the oil in CTK 1 , CTK 4 , ..., CTK 2i , ..., and CTK 2K is ready to feed; 5) the volume of crude oil of type K remaining in storage tanks is β<α K , and after processing this amount of oil type K, distiller DS K should switch to process oil type j.Then, the system is schedulable and the volume β of oil type K can be used up without being mixed with other oil type.
Lemma 3.1 states that for the entire scheduling horizon, if there are three charging tanks for each distiller and there is enough crude oil in the charging tanks at the beginning of the scheduling horizon, a feasible short-term schedule can be found.When the charging-tank-switch-overlap constraint is considered, we can show that if the conditions given in Lemma 3.1 are satisfied, the system is still schedulable.In the following discussion, we show how these conditions are included in the models as constraints such that a feasible refining schedule can be obtained.
It follows from the initial state information that some crude oil arrives at the port at time t with τ s <t<τ e .This implies that only after time point τ>tcan such crude oil be ready to feed a distiller.With time point t, the oil unloading rate, the oil residency time, and the oil transportation rate from a storage tank to a charging tank known, τ can be calculated.Thus, when Q tankers arrive during the scheduling horizon at times t 1 , t 2 , ..., and t Q , respectively, with τ s <t 1 <t 2 < ... < t Q <τ e ,w e can obtain τ 1 , τ 2 , ..., and τ Q with τ s <τ 1 <τ 2 < ... < τ Q <τ e such that the crude oil in the tanker that arrives at t i can be available for feeding after τ i .In this paper, we assume that τ 1 , τ 2 , ..., and τ Q are known.This way, the scheduling horizon is and [τ Q , τ e ].Alternatively, they can be called buckets 0, 1, ..., and Q, respectively.
To describe the effectiveness to process a crude oil type by a distiller, a cost associated with a type of crude oil and a distiller can be set.If it is the best to process crude oil type i by distiller j, small cost is set.We can order the crude oil types that can be processed by a distiller from the best to the worst and set the cost in an increasing way.If crude oil type i cannot be processed by distiller j, the cost is set to be a very large number.
To develop the refining scheduling approach, we present the following notation.Capacity of the pipeline.

V i-c
Volume of crude oil type i in the charging tanks at time τ s , i ∈ COT.

W ij
Remaining volume of crude oil type i in the charging tank feeding distiller j at time τ s , i ∈ COT and j ∈ DS.

V i-p
Volume of crude oil type i in the pipeline at time τ s , i ∈ COT, with Volume of crude oil type i in the storage tanks at time τ s , i ∈ COT.

V ik
Volume of crude oil type i that is available for feeding after time τ k , i ∈ COT and k ∈ BUK.F i (MAX) Maximal feeding rate allowed for distiller i ∈ DS.

F i (MIN)
Minimal feeding rate allowed for distiller i ∈ DS.

F p max
Maximal oil transportation rate via the pipeline.

Ω i
Set of crude oil types that can be processed by distiller i, i ∈ DS; f ij Oil feeding rate to distiller i during bucket j, i ∈ DS and j ∈ BUK.
The proposed scheduling approach is a three-phase one.In phase 1, the production rate to maximize the production is determined.The amount of crude oil to be processed for each distiller during each bucket is, therefore, found.Then, in phase 2, the crude oil types and amount of crude oil are assigned to the distillers to minimize the crude oil type assignment cost.In phase 3, the result obtained in phase 2 is adjusted, and the crude oil parcels and their sequence are determined to minimize the changeover cost.

B. Determination of Production Rate
In this section, a model is presented to solve the problem of phase 1 as follows.To maximize the production is to maximize the crude oil feeding rate for each distiller subject to (3.9) Objective (3.1) maximizes the production, and meanwhile, minimizes crude oil inventory cost as well.Constraint (3.2) states that for every distiller the crude oil feeding rate should be in an allowable range.As indicated in Lemma 3.1, the total production rate for the system cannot be greater than the maximal flow rate of the pipeline.This is guaranteed by Constraint (3.3).
In bucket 0, only the crude oil in charging tanks, pipeline, and storage tanks can be usable.Constraint (3.4) says that f j 0 's should be set such that there is enough crude oil to be processed at each distiller, which implicitly gives the constraint that there is enough crude oil in the charging tanks at the beginning of the scheduling horizon as required by Lemma 3.1.Because a type of crude oil can be processed by more than one distiller, the satisfaction of Constraint (3.4) cannot guarantee that there is enough crude oil to be processed for the entire system in bucket 0. Thus, Constraint (3.5) is introduced.Similarly, Constraints (3.6) and (3.7) are introduced to guarantee that there is enough crude oil to be processed for each distiller and the entire system in the buckets 0, 1, ..., n with 1 ≤ n ≤ Q -1.Constraints (3.8) and (3.9) mean that during the entire scheduling horizon, there is enough crude oil for each distiller and the whole system, respectively.Note that at the end of the scheduling horizon, the pipeline should be full of oil; thus, it subtracts V p from the left size in Constraint (3.9).It can be seen that in the model, f ij 's are the decision variables and they are continuous variables and there is no discrete event variable at all.Thus, Problem P1 is formulated as a linear programming and is easy to solve.

C. Assignment of Crude Oil to Distillers
With the production rate obtained by solving Problem P1, the amount of crude oil to be processed by each distiller is known.Then, it needs to divide the amount of crude oil to be processed during the scheduling horizon into a number of parcels and assign these parcels into the distillers.This problem is called Problem P2.Moreover, the number of parcels of crude oil is not known and needs to be determined by the scheduler.Thus, it seems that such a problem is a combinatorial problem and is hard to solve.However, if we treat the types of crude oil as suppliers and the distillers as demanders, this problem can be formulated as a transportation problem.It is sure that by solving such a transportation problem, a number of parcels of crude oil with different types are assigned to each distiller.By merging the parcels of the same type of crude oil, a schedule can be formed for each distiller.This way, this problem can be solved easily.

TABLE I TRANSPORTATION MODEL FOR PROBLEM P2
Let Θ ij , i ∈ DS and j ∈ BUK, denote bucket j of distiller i; Φ i−c , i ∈ COT, crude oil type i in the charging tanks; Φ i−p , i ∈ COT, crude oil type i in the pipeline; Φ i−s , i ∈ COT, crude oil type i in the storage tanks; and Φ ij , i ∈ COT and j ∈ BUK, crude oil type i available after τ j .The transportation problem model for P2 is presented in Table I.
To make a refining schedule feasible, crude oil that is available after τ j cannot be assigned to a distiller for processing in a bucket k with k<j,orΦ ij cannot be assigned to Θ hk with k< j.Thus, big M is set in the intersection of Φ ij and Θ hk .In fact, this is why the scheduling horizon is divided into a number of buckets when the problem is modeled.It should also be pointed out that C ij may be equal to M , meaning that crude oil type i cannot be processed by distiller j.
To make a refining schedule compatible with the initial state, if a charging tank with crude oil type i in it is feeding distiller j at the initial state, the remaining oil in that tank should be fed into distiller j in the schedule.This implies that such crude oil should be assigned into distiller j in the schedule.In a refinery plant, the number of distillers is less than the number of crude oil types.Hence, without loss of generality, we assume that the crude oil type being fed into distiller j is j at the initial state, and the remaining volume is W jj .Further, assume that (τ 1 − τ s )f j 0 ≥ W jj .Thus, the demand of Θ j 0 is (τ 1 − τ s )f j 0 − W jj as shown in the model.If (τ 1 − τ s )f j 0 ≥ W jj is not satisfied, we can just set the demand of Θ j 0 to be zero and the demand of Θ j 1 to be (τ 2 − τ 1 )f j 1 + (τ 1 − τ s )f j 0 − W jj .Correspondingly, the supply of Φ j −c becomes V j −c − W jj asshowninthe model.
At the end of the scheduling horizon, the pipeline must be full of crude oil.Thus, there is a crude oil demand for filling the pipeline with amount V p .
To guarantee the existence of a solution for a transportation problem, the total demand must be equal to the total supply.By Problem P1, the total supply is greater than or equal to the total demand.Thus, a dummy distiller denoted by DM-DS is necessary and its demand is As discussed previously, the conditions given in Lemma 3.1 should be satisfied to make a refining schedule feasible.According to Lemma 3.1, it needs at least three charging tanks for a distiller to make a refining schedule realizable, which is not included in P1 as a constraint.Hence, this constraint should be considered in P2.In a refinery plant, if all the charging tanks are usable, this condition can be easily satisfied.In general, in a refinery plant, i∈COT V i−c + i∈COT V i−p is less than the total amount for processing during the scheduling horizon.Thus, to guarantee the condition that there are three charging tanks for a distiller to be satisfied, all the charging tanks with oil in it at τ s should be usable during the scheduling horizon.This implies that all the crude oil in the charging tanks at τ s cannot be assigned to the dummy distiller DM-DS, and such crude oil is impossible to assign to the pipeline.The crude oil in the pipeline at τ s takes spaces of charging tanks and cannot be assigned to dummy distiller DM-DS either.Hence, the corresponding costs are set to be big M .
With the aforementioned analysis, by solving the transportation model given in Table I, a feasible refining schedule can be obtained.It is well known that a transportation problem is easier to be solved than a linear programming, and there are standard commercial software tools for this purpose.Thus, Problem P2 can be solved very efficiently.Note that the solution is composed of a number of crude oil parcels distinguished by oil types.It should be pointed out that the great challenge of scheduling crude oil operations results from the hybrid property of the process.Although Problem P2 is a continuous optimization problem, its solution is composed of a number of discrete crude oil parcels.Thus, P2 implicitly solves a hybrid optimization problem.

D. Sequencing Parcels
To minimize the changeover cost, it is best to assign crude oil in a charging tank to a single distiller.However, by solving the transportation problem given in Table I, crude oil in a charging tank at τ s may be assigned to more than one distiller.For example, there is volume V of crude oil in a charging tank at τ s ;i t may assign V 1 to Distiller 1 and V 2 to Distiller 2 with V 1 + V 2 = V .For this case, if possible, it is better to adjust the assignment such that V is assigned to distillers 1 or 2 only.It can be done as follows.
1) Assume that another crude oil type, say type 2, is assigned to distiller DS 1 , and meanwhile, there is crude oil type that can be processed by distiller DS 2 , say type 3, and is assigned to DM-DS with volume V 3 ≥ V 2 .Then, we can reassign the crude oil as follows: a) V is assigned to DS 1 ; b) take V 2 of crude oil type 3 from DM-DS to DS 2 ; and c) take V 2 of crude oil type 2 from DS 1 to DM-DS.2) Assume that another crude oil type, say type 2, is assigned to DS 1 and crude oil type 2 can be processed by DS 2 too.Then, we can reassign the crude oil as follows: a) V is assigned to DS 1 ; and b) take V 2 of crude oil type 2 from DS 1 to DS 2 .The computational complexity of the aforementioned algorithm can be analyzed as follows.Assume that there are N charging tanks in which there is crude oil at the initial state.By requirement, such crude oil should be processed during the next scheduling horizon.Further, assume that the crude oil type in different charging tank is different, and each type of crude oil can be assigned to at most G distillers with G equal to or less than Π, i.e., the number of distillers in the plant.For a charging tank, only G − 1 adjustments are needed to complete the previous algorithm.Thus, there are no more than N × (G − 1) adjustments, which are of polynomial complexity.
Note that, in solving the transportation problem given in Table I, the crude oil from the charging tanks, pipeline, storage tanks, and so on is treated as from different suppliers.However, two parcels of crude oil assigned to a distiller from different suppliers may be of the same type.These parcels should be merged if they can be processed one after another such that changeover cost is reduced.Because the number of crude oil types is limited, the parcel merging is very simple.
With crude oil reassigned and parcel merging, we need only to sequence the parcels of crude oil for each distiller according to the order of available time to obtain a feasible refining schedule.
Up to now, we have presented the approach for refining scheduling.By this three-phase approach, we successfully discompose a hybrid optimization problem into subproblems such that each subproblem contains only continuous or discrete event variables.In addition, multiple objectives are effectively handled in different phase.To solve the problem, it needs to solve a linear programming problem, a transportation problem, and adjusting and sequencing the parcels.This way, the subproblems in all the phases can be efficiently solved.Thus, the proposed approach for refining scheduling is computationally efficient and can be used for practical applications.Furthermore, by combining the approaches for a detailed schedule presented in [29]     and [30], a short-term schedule for crude oil operations can be efficiently found.This is a significant advancement in this research field.

IV. INDUSTRIAL CASE STUDY
This section presents a case study to show the application of the approach that is proposed in this paper.This case problem arises from a practical application scenario of a refinery in China.The refinery has three distillers 1, 2, and 3. Three times each month, a short-term schedule should be created for the next ten days.For the scheduling horizon in this paper, there are six types of crude oil to be processed.Crude oil type #1 can be processed by only Distiller 1 and Crude oil #2 by only Distiller 2. Crude oil #3 can be processed by all three distillers; however, it is best to be processed by Distiller 1, then by Distiller 3, and it is the worst if it is processed by Distiller 2. Crude oil types #4, #5, and #6 can be processed by both Distillers 2 and 3 with different cost.Such cost associated with crude oil types and distillers is    given in Table II, where "M " means that a type of oil cannot be processed by the corresponding distiller.
During the scheduling horizon, there are nine charging tanks available.Initially, there is crude oil in Charging Tanks #129, #128, #116, #117, and #115, and the others are empty.At this state, Tanks #129, #128, and #116 are feeding Distillers 1, 2, and 3, respectively.The initial state of the charging tanks is shown in Table III.The capacity of the pipeline is 12 000 tons and the pipeline is full of crude oil type #2.There are 28 000 tons of crude oil #3, 54 000 tons of crude oil #2, and 64 000 tons of crude oil #1 in the storage tanks.During scheduling horizon, a tanker will arrive with 132 000 tons of crude oil #6.Assume that τ s = 0 h.Then we can obtain τ 1 = 96 h, or after time 96 h, the oil in the tanker can be used for distillation.Hence, the scheduling horizon is divided into two buckets [0, 96] and [96,240].
The minimal production rates for the three distillers are 312.5, 205, and 458 tons/h, and maximal production rates are 375, 230, and 500 tons/h, respectively.The maximal flow rate of the pipeline is f p max = 1250 tons/h.Four hours are required for both oil residency time for charging tanks and charging-tank-switchoverlap time.
With the initial state information, according to Lemma 3.1, there is enough crude oil in the charging tanks for obtaining a realizable refining schedule.In addition, if all the oil in the charging tanks is processed during the scheduling horizon, there are enough charging tanks for scheduling the system.Thus, the approach presented in the previous section can be used to find a realizable refining schedule.
By using the initial state information, it is easy to write down the linear programming model for problem P1 for this case.By solving P1, we obtain f 10 = f 11 = 375 tons/h, f 20 = f 21 = 230 tons/h, and f 30 = f 31 = 500 tons/h.This is the maximal production rate for the system and the crude oil inventory is also minimized.With the production rate for each distiller in each bucket, the amount of crude oil to be processed by each distiller in each bucket can be obtained as shown in Table IV.
At the initial state, Charging Tanks #129, #128, and #116 are feeding Distillers 1, 2, and 3, respectively.Thus, to make a refining schedule compatible with the initial state, 27 000 tons of type #3 oil, 30 000 tons of type #2 oil, and 27 000 tons of type #4 oil should be assigned to bucket 0 of Distillers 1, 2, and 3, respectively.With this assignment, the modified amount of crude oil to be processed by each distiller in each bucket is shown in Table V ).After this assignment, 1000 tons of type #1 oil, 54 000 tons of type #2 oil, 28 000 tons of type #3 oil, and 80 800 tons of type #6 oil remain.By P 22 , P 32 , and P 33 , it assigns the oil in Tanks #117 and #115 to more than one distiller such that the oil in one tank is divided into two parcels, leading to the changeover cost.Thus, according to the proposed method, this can be adjusted: 1) move P 22 from Distiller 2 to Distiller 3; 2) create P 24 with 13 200 tons of type #2 oil from the storage tanks; and 3) take 13 200 tons of oil from P 34 .Then, we merge: 1) P 12 and P 13 ;2) P 23 and P 24 with P 23 being processed before P 24 ; and 3) P 32 , P 33 , and P 22 , for they are the same type of crude oil.This way, a realizable refining schedule is obtained as shown in Fig. 4. It can be seen that although it is the best for Distiller 2 to process crude oil type #5, it is assigned to Distiller 3; otherwise, there would not be enough oil for Distiller 3 to process during bucket [0, 96] thereby an infeasible solution.In addition, 28 000 tons of oil type #3 is not used although it can be processed by all the distillers.It is meaningful to keep this type of crude oil for Distiller 1 to process for the next scheduling horizon; otherwise, there is no oil that can be processed by Distiller 1 during that time.Thus, the obtained refining schedule is a very good one.
By using the methods presented in [29] and [30], a detailed schedule to realize the refining schedule obtained is easily created.The detailed schedules of distiller feeding and charging tank filling are shown in Figs. 5 and 6, respectively.It can be seen that all the constraints, including crude oil residency time and charging-tank-switch-overlap constraints, are satisfied.
It should be pointed out that this case problem is from practical applications with all the constraints considered.It is extremely difficult for an existing mixed integer mathematical programming model to solve such large problems if it is not impossible.By combining the method presented in this paper and that in our previous work [29], [30], a short-term schedule can be easily found.
V. C ONCLUSION Short-term scheduling for crude oil operations is a combinatorial problem and involves extreme detail.Thus, it is very complicated and, up to now, there are no efficient technique and software tool in practice.Thus, it is crucial to develop efficient methods to solve this problem.For this purpose, a two-level approach is presented and schedulability conditions are derived in [29] and [30].Based on the schedulability conditions, given a realizable refining schedule, it is easy to find a detailed schedule at the lower level.With the schedulability conditions, this paper solves the upper level problem of finding the optimal and realizable refining schedule.It successfully decomposes a hybrid optimization problem into subproblems such that each subproblem contains continuous or discrete event variables only but not both.In addition, multiple objectives are effectively handled in different phases.Thus, the entire short-term scheduling problem of crude oil operations is solved.The approach proposed in this paper is very efficient, for it needs to solve a linear programming problem, a transportation problem, and adjustment problems.They all can be solved very efficiently.
As pointed out in [27], there are various objectives that are to be optimized in finding a detailed schedule at the lower level.Although detailed scheduling methods are presented in [29] and [30], the operations are not optimized.Optimization of detailed schedules at the lower level is one of our future studies.Developing methods for short-term scheduling of crude oil operations is not enough.One needs efficient software tools for practical use.It is also our future work to develop such software tools by using the proposed methods.

Fig. 1 .
Fig. 1.Architecture of short-term scheduling for crude oil operations.

Fig. 5 .
Fig. 5. Detailed schedule of distiller feeding for the case study.
{0, 1, ..., Q} Set of buckets that begin at τ s , τ 1 , ..., and τ Q , respectively.C ij Cost if crude oil type i is processed by distiller j, i ∈ COT and j ∈ DS.V p

TABLE II COST
ASSOCIATED WITH CRUDE OIL TYPES AND DISTILLERS

TABLE III INITIAL
STATE OF THE CHARGING TANKS

TABLE IV AMOUNT
(TON) OF CRUDE OIL TO BE PROCESSED IN EACH BUCKET

TABLE V MODIFIED
AMOUNT (TON) OF CRUDE OIL TO BE PROCESSED IN EACH BUCKET

TABLE VI TRANSPORTATION
PROBLEM MODEL FOR PROBLEM P2 . Notice that 22 080 tons of crude oil to be processed by Distiller 2 in bucket 0 is less than the amount in Charging Tanks #128.Hence, the amount of oil to be processed by Distiller 2 in bucket [96, 240] is modified as 25 200 tons.Distiller 3: 27 000 tons of type #4 oil in Tank #116 (parcel P 31 ), 21 000 and 20 800 tons of type #5 oil in Tanks #117 and #115 (parcels P 32 and P 33 ), and 51 200 tons of type #6 oil (parcel P 34