A Linear Relaxation-Based Heuristic for Iron Ore Stockyard Energy Planning

Planning the use of electrical energy in a bulk stockyard is a strategic issue due to its impact on efficiency and responsiveness of these systems. Empirical planning becomes more complex when the energy cost changes over time. The mathematical models currently studied in the literature consider many actors involved, such as equipment, sources, blends, and flows. Each paper presents different combinations of actors, creating their own transportation flows, thus increasing the complexity of this problem. In this work, we propose a new mixed integer linear programming (MILP) model for stockyard planning solved by a linear relaxation-based heuristic (LRBH) to minimize the plan’s energy cost. The proposed algorithm will allow the planner to find a solution that saves energy costs with an efficient process. The numerical results show a comparison between the exact and heuristic solutions for some different instances sizes. The linear relaxation approach can provide feasible solutions with a 3.99% average distance of the objective function in relation to the optimal solution (GAP) in the tested instances and with an affordable computation time in instances where the MILP was not able to provide a solution. The model is feasible for small and medium-sized instances, and the heuristic proposes a solution to larger problems to aid in management decision making.


Introduction
Decisions about raw material distribution, such as that of coal and iron ore, from the mine to the client are critical strategic issues for global mining industries. An essential link in this logistics chain is the stockyard, which stands out as a bottleneck and significantly influences the logistic chain performance [1]. When dealing with solid bulk, planning the allocation of stockpiles and sequencing the use of long-term resources have a direct impact on the total energy cost. This energy can originate from different sources, such as the regular power grid, or can be bought from another producer with different prices each day.
The efficient use of electrical equipment for stockpile allocation according to minimal energy costs will provide a higher capacity of resources, lower total costs, and a better overall result in this supply chain. On the other hand, the allocation of electrical machines used in the stockyard without seeking energy conservation can impair the port processes and may even interrupt the energy supply for a period of time. and waste in the production process. Due to the full range of production scheduling problems, there are several approaches for stockyard planning, including manual computer-supported programming (such as interactive Gantt charts), expert systems, mathematical programming, heuristics, evolutionary algorithms, and different artificial intelligence methods (e.g., [2][3][4][5][6][7][8][9]). The optimal solution will result in significant savings through better capacity utilization. In addition, other considerations related to the system may ensure improvements for the company, such as reducing environmental impact and energy costs and controlling violations of regulations and operations.
The operations in a port stockyard of iron ore exportation are unique, complex, and dynamic. The purpose of planning iron ore stockpiles in the port stockyard is to load ships with the quantity and quality of iron ore requested by customers in the shortest possible time. Moreover, blends of different iron ore batches to meet the type of iron ore specified by the customer must be produced during the formation and reclamation of the stockpiles in the stockyard (see Figure 1). Solutions must take into account that the arrival and departure times of trains and ships are relatively inflexible. An essential feature of this problem is that the space available in the stockyard can accommodate the ore batches that arrive from the trail system and allow for changes in alternative plans in the event of equipment failure, thus ensuring the optimum planning of piles in the yard. There are few problems discussed in the literature similar to the patio planning problem studied in this paper. The management of port stockyard operations involves the effective interaction of the port's subsystems. Management comprises a vector of activities and sequential processes, from the unloading of cargo onto land to its loading onto ships. In real situations, the equipment or participants must be considered, such as the flows between the machines, the amount of cargo loaded on the ships, and the number of ships served, thereby increasing the complexity. Planning a stockyard-port system considering a variety of products is made more complicated by the emergence of new flows and variables that measure the equipment or changes in their characteristics [9].
The main processes considered in the planning of iron ore stockpiles are the arrival of the wagons at the car-dumpers, the routes that assist in stacking and reclaiming, the stacking and recovery process and loading the ships. In stockpile planning, a ship sends a notice of when it will arrive at the port. A time of arrival is then estimated, and the required demand in each berth is determined. Train wagons transport the iron ore batches removed from the mine to the reception system for the order to be met. Throughout the planning process, there are various subtypes of iron The management of port stockyard operations involves the effective interaction of the port's subsystems. Management comprises a vector of activities and sequential processes, from the unloading of cargo onto land to its loading onto ships. In real situations, the equipment or participants must be considered, such as the flows between the machines, the amount of cargo loaded on the ships, and the number of ships served, thereby increasing the complexity. Planning a stockyard-port system considering a variety of products is made more complicated by the emergence of new flows and variables that measure the equipment or changes in their characteristics [9].
The main processes considered in the planning of iron ore stockpiles are the arrival of the wagons at the car-dumpers, the routes that assist in stacking and reclaiming, the stacking and recovery process Energies 2020, 13, 5232 3 of 18 and loading the ships. In stockpile planning, a ship sends a notice of when it will arrive at the port. A time of arrival is then estimated, and the required demand in each berth is determined. Train wagons transport the iron ore batches removed from the mine to the reception system for the order to be met. Throughout the planning process, there are various subtypes of iron ore, hereafter called "products". After the batches arrive at the unloading terminal (reception) system, they are unloaded by the car-dumpers onto conveyor belts, which will take them to the stockyard.
Then, a stockpile starts to be built to meet demands. Once a ship's designated stockpile has been built, the stocks can remain at rest until their destination is determined. Vessels arriving at the port go to their respective berths, and the reclamation of stockpiles begins. The removal of stockpiles on the patios by a bucket-wheel reclaimer (BWR) is called stockpile reclaiming. After reclaiming, the transportation of the stockpile to the berth starts immediately. The ship's loading time is determined according to berth capacity, the types of reclaiming equipment, and the amount of the product. After finishing the shipment, the ship will leave the system immediately.
An essential factor in this sector is the product's availability at the appropriate time for it to serve the customers. A mining company that handles a great deal of cargo must be concerned with the process details to seek an efficient distribution plan. With a high volume, any savings can have a significant impact on the planning and business results. In this way, energy efficiency is an essential factor in evaluating planning. Due to the high volume of iron ore being commercialized, these companies may have parallel contracts with local energy companies, produce their energy or, even buy power from alternative sources. Global efficiency will be at its optimum after choosing the best mix of periods to use the machine according to the available energy price.

Contribution
This paper aims to propose a new mathematical model based on mixed integer linear programming (MILP) and linear relaxation-based heuristic (LRBH) for iron ore stockyard energy planning (IOSEP). This model considers the flows between the stockyard's electrical equipment and the raw material supply with different types of ore. The objective is to propose a solution for the IOSEP problem using a problem definition with the main objective of minimizing the energy cost in the planning horizon (or time window). Therefore, this work's contributions include the following: (I) The development of an MILP model to minimize the energy costs of an iron ore stockyard including the production from mines and the demands of the berth; (II) an LRBH with a proposal using a lower bound to choose the relaxed variables applied where the heuristic process will be faster, and; (III) considering the variable cost of energy along the horizon planning.
The main highlights of this study are its contribution of a mathematical model for use in a stockyard planning problem from action determined by the minimization of energy costs, and the proposal of an alternative method to determine a solution with good quality that can be achieved within limited computational time. The simulations were performed using random values from the literature or estimated using information without a source. The GAP (distance) between the objective functions of the LRBH and LP models reached an average of 3.99%. If we consider only the largest dimension of the IOSEP using the GAP between the LRBH and the linear programming (LP), the GAP is even smaller and reaches a feasible solution to large instances. Section 2 presents a code-based systematic literature review of works related to the theme of this paper. Section 3 describes the mathematical model and the LRBH algorithm for the IOSEP. In Section 4, we validate the mathematical model and the LRBH from computational experiments using CPLEX 12.5 [10]. Finally, the conclusions of this work are presented in Section 5.

Literature Review
A proper management of stockyards is essential to ensure global performance with a strategic balance between maximizing planning accuracy and throughput while minimizing cost. This is especially relevant nowadays, as the demand is slowing down, inhibiting investment in new facilities, Energies 2020, 13, 5232 4 of 18 and the competition between exporting companies is increasing. Thus, the most common approach today involves optimizing the usage of available assets to reach the best results without the need to buy new equipment or facilities. In this environment, the use of optimization tools and techniques becomes an excellent option to generate low-cost and practical solutions to existing problems.
The solution to the stockyard planning problem is not trivial, with different alternatives and objectives available to fit each model to the problem in order to propose and build the most effective and potential use. This problem is NP-hard, i.e., it requires exponential time to obtain an optimal global solution [11]. It is also essential to look for alternatives with good quality local solutions that can be employed by stockyard operators and managers in the decision-making process. A nomenclature is presented in Table 1 with the main features and highlights of the literature on dry bulk stockyard planning reviewed in this section. According to the nomenclature established in Table 1, Table 2 presents these features in stockyard planning problem papers and shows that the models most commonly proposed are mixed integer programming (MIP) and mixed integer linear programming (MILP). Some papers planned coal (e.g., [12,13]), solid bulk [14] and iron ore [15] stockyards, and the papers may consider one or more product and period, as well as different objectives. The work in [12] studied the planning of a solid bulk stockyard for the coal chain in Australia, focusing on train schedules. Both problems were separated into several modules with each solved through a greedy heuristic. For the same type of stockyard, the authors in [13] developed a planning technique based on an improved greedy construction with the use of the entire schedule to increase the flow of raw materials and decrease the average time that the ships spend in the berth.
The research in [14] described the modeling of stockpiles and BWR for simulation studies in a virtual reality environment. In [15], the authors presented stacker-reclaimer (S-R) scheduling to minimize the makespan for a given set of handling operations using a genetic algorithm (GA). The authors in [16] developed a decision-support system (dynamic planner) for a dry bulk terminal. After an extensive interview with the operators to understand the selection of routes for each order of products reaching the stockyard, the authors coded the information to feed the decision-support system. The studies in [14] and [16], however, did not present mathematical models or comparison with an exact technique to evaluate the solutions of their proposals.
The authors in [17] proposed a heuristic for planning stockpiles and scheduling resources to minimize delays in production and the coal age in the stockyard with two reclaimers in a time window in a two-hour range. A model of stockyard operations within a coal mine was described, and the problem was formulated as a bi-objective optimization problem (BOOP).
The authors [18] address a hierarchical optimization model via a bi-objective LP model for a coal stockyard system in Hunter Valley, Australia, as a mechanism for planners to control the shipping stem characteristics. The work in [19] presents a series of comparisons between different techniques developed using algorithms such as the heuristics of SPLIT and PARTITION, along with their variations. In this study, random instances were developed to compare the results. The evaluation parameters were defined according to processing time and the parameters for the stockpile and stockyard, but a comparison with an exact technique was not performed to evaluate these algorithms.
The authors in [20,21] applied the reschedule S-R operations to increase the performance of the stockyard system. The authors used a simulation-based approach with queuing models fed by historical data to find scenarios where the system performance would increase by avoiding a delay in the arrival of trains to and the departure of ships from a dry bulk and coal stockyard, respectively. The authors in [22] developed an algorithm for stockyard management by maximizing the system throughput. This study compared the efficacy of the algorithm in different instances and analyzed the rules of stockyard management.
In [23], the authors focused on reclaimer scheduling in a limited stockyard (NP-complete) with stockpile replacement and reclamation sequencing using approximation algorithms and a branch-and-bound algorithm to find an exact solution to the proposed instances of the problem. For planning an iron ore stockyard, the work in [24] presents a proposal for mathematical modeling to control the stockyard-port system, including receipt through a system of rails, stockyard equipment, allocation and availability at the port, considering the quantities to be produced, and the prices and demands, according to the achievement of goals defined by higher levels. The technique used to solve the problem was the column generation (CG) with branch-and-price.
The work in [25] defined an MILP model to optimize a biomass terminal by minimizing the total operational and material cost of this terminal and analyzed the output of the proposed model according to real word data instead of only the experiences of employers. The authors in [26] developed a monolithic mixed integer programming (MIP) for a dry bulk stockyard including the subproblems such as berth allocation, stockpile allocation, and S-R scheduling.
Lastly, the work in [9] presented a bi-objective MILP model to determine the ships that will be served by each berth in a given queue of customers. The authors used objective functions separately and evaluated their behavior in the studied instances. Table 2 classifies the stockyard planning problems according to the following specifications: the problem definition, modeling, the objectives and the solution method. Table 2 also outlines the literature review of the stockyard planning problem to help identify research gaps. The majority of the Energies 2020, 13, 5232 6 of 18 literature focused on coal stockyards with different objectives, and the various problems have been solved via optimizing methods such as heuristics, metaheuristics, and exact techniques.
In this paper, we developed an MILP mathematical model based on [24] to plan an iron ore stockyard according to the energy cost of equipment usage and considering a variable cost over time. We solve this model using an exact technique with CPLEX [10] and a linear relaxation-based heuristic (LRBH) via Python language and CPLEX.

Problem Description
In the stockyard-port system studied in this paper, we assume that the iron ore is transported through a set of routes, interconnecting the unload terminals (car-dumpers), stockyards and berths for ships. Figure 2, shows the different routes in the stockyard used to transport iron ore to the vessel. Equipment such as the stacker, reclaimer, conveyor belt and ship loader can share different routes. For example, in Figure 3, the conveyor belt shares routes 1 and 2, while the ship loader in the berth shares routes 1 and 3.
Energies 2020, 13, x FOR PEER REVIEW 6 of 18 literature review of the stockyard planning problem to help identify research gaps. The majority of the literature focused on coal stockyards with different objectives, and the various problems have been solved via optimizing methods such as heuristics, metaheuristics, and exact techniques.
In this paper, we developed an MILP mathematical model based on [24] to plan an iron ore stockyard according to the energy cost of equipment usage and considering a variable cost over time. We solve this model using an exact technique with CPLEX [10] and a linear relaxation-based heuristic (LRBH) via Python language and CPLEX.

Problem Description
In the stockyard-port system studied in this paper, we assume that the iron ore is transported through a set of routes, interconnecting the unload terminals (car-dumpers), stockyards and berths for ships. Figure 2, shows the different routes in the stockyard used to transport iron ore to the vessel. Equipment such as the stacker, reclaimer, conveyor belt and ship loader can share different routes. For example, in Figure 3, the conveyor belt shares routes 1 and 2, while the ship loader in the berth shares routes 1 and 3. are the routes from the unloading terminal to the stockyard ( ).
is the routes that start in the unloading terminal and reach the berths ( ). links the stockyard to the berths.
Iron ore comes from the mines to the unloading terminals (car-dumpers), situated at the stockyard-port, using railways. At these unloading terminals, the wagons unload their contents onto conveyor belts to transport this material to the stackers. This machine deposits the ore into stockpiles located at different positions of the yard for storage, as shown in Figures 1 and 2. The construction of all piles to serve a single vessel can take several days. These stockpiles will remain at rest until the ship arrives at berth. When this event occurs, the reclaimer machine places the stockpiled ore onto the conveyor belts to send this product immediately to the ships. This study considers a set of stockpiles for each ship that arrives at the port's berth. A ship cannot arrive at the berth before its previously estimated time. The ship's loading time is directly proportional to the loading and recovery equipment involved.  Iron ore comes from the mines to the unloading terminals (car-dumpers), situated at the stockyard-port, using railways. At these unloading terminals, the wagons unload their contents onto conveyor belts to transport this material to the stackers. This machine deposits the ore into stockpiles located at different positions of the yard for storage, as shown in Figures 1 and 2. The construction of all piles to serve a single vessel can take several days. These stockpiles will remain at rest until the ship arrives at berth. When this event occurs, the reclaimer machine places the stockpiled ore onto the conveyor belts to send this product immediately to the ships. This study considers a set of stockpiles for each ship that arrives at the port's berth. A ship cannot arrive at the berth before its previously estimated time. The ship's loading time is directly proportional to the loading and recovery equipment involved.
Energies 2020, 13, x FOR PEER REVIEW 6 of 18 literature review of the stockyard planning problem to help identify research gaps. The majority of the literature focused on coal stockyards with different objectives, and the various problems have been solved via optimizing methods such as heuristics, metaheuristics, and exact techniques.
In this paper, we developed an MILP mathematical model based on [24] to plan an iron ore stockyard according to the energy cost of equipment usage and considering a variable cost over time. We solve this model using an exact technique with CPLEX [10] and a linear relaxation-based heuristic (LRBH) via Python language and CPLEX.

Problem Description
In the stockyard-port system studied in this paper, we assume that the iron ore is transported through a set of routes, interconnecting the unload terminals (car-dumpers), stockyards and berths for ships. Figure 2, shows the different routes in the stockyard used to transport iron ore to the vessel. Equipment such as the stacker, reclaimer, conveyor belt and ship loader can share different routes. For example, in Figure 3, the conveyor belt shares routes 1 and 2, while the ship loader in the berth shares routes 1 and 3. are the routes from the unloading terminal to the stockyard ( ).
is the routes that start in the unloading terminal and reach the berths ( ). links the stockyard to the berths.
Iron ore comes from the mines to the unloading terminals (car-dumpers), situated at the stockyard-port, using railways. At these unloading terminals, the wagons unload their contents onto conveyor belts to transport this material to the stackers. This machine deposits the ore into stockpiles located at different positions of the yard for storage, as shown in Figures 1 and 2. The construction of all piles to serve a single vessel can take several days. These stockpiles will remain at rest until the ship arrives at berth. When this event occurs, the reclaimer machine places the stockpiled ore onto the conveyor belts to send this product immediately to the ships. This study considers a set of stockpiles for each ship that arrives at the port's berth. A ship cannot arrive at the berth before its previously estimated time. The ship's loading time is directly proportional to the loading and recovery equipment involved.   The present study considers a variety of products between the stockpiles, even though the primary mining sector and product is iron ore. This ore can be differentiated according to the levels of quality and purity required by the customers and thus separated into products that are allocated into different stockpiles. The composition of each product is made from a combination (or blend) of raw material in the stockpiles. When the product is not available or it is necessary to construct the stockpile in another stockyard previously scheduled for a different product, there will be penalties related to expense of transforming one quality of iron ore into another to meet the demands. Another type of penalty is related to delays in loading trains from the mine or in unloading the wagon at the reception terminal.
Stackers and reclaimers move freely to the stockpile position. For the stackers and reclaimers to function properly, they must remain at a distance to avoid collisions. In this work, the movement of stackers and reclaimers is considered to be synchronized, disregarding any interference from each other in their operations.

Problem Formulation
The following nomenclature is used to formulate the IOSEP model: Set of routes (stockyards / piers); R x s Subset of routes r ∈ R x that reach subarea s; R z s Subset of routes r ∈ R y that from subarea s; R y n Subset of routes r ∈ R y that reach pier n; R z n Subset of routes r ∈ R z that reach pier n; R x m Subset of routes x that use equipment m; R y m Subset of routes y that use equipment m; R z m Subset of routes z that use equipment m.

Parameters
Ce r t Energy cost to use the route r in period t; Cs s pt Energy cost to keep in the product p in storage sub-area s during period t; Cir pt Energy cost for not meeting the supply and keeping product p at the reception in period t; c rx Capacity (in tons/hour) of route r ∈ R x ; c ry Capacity (in tons/hour) of route r ∈ R y ; c rz Capacity (in tons/hour) of route r ∈ R z ; β pp Energy cost associated with replacing product p with product p to meet the demand of product p; j m t Available time (in hours) for the use of equipment m in period t; b m Capacity of equipment m (in tons/hour); a pt Supply of product p at the beginning of period t; d npt Demand of product p for a ship moored at berth n at the beginning of period t l s pt Storage capacity of subarea s for product p in period t. Variable X r pt Time taken in period t to transport product p from the reception to the stockyard using route r ∈ R x . Y r p pt Time taken to transport product p to meet the demand of product p in period t using route r ∈ R y . When p is equal to p, the product delivered is the same as what was requested. Z r pp t Time taken to transport product p to meet the demand of product p in period t using route r ∈ R z . When p is equal to p, the product delivered is the same as what was requested.

IR pt
Represents the amount of product p in the reception subsystem that was not delivered at the end of period t. e s pt Amount of product p stored in subarea s during period t. f s pt f s pt = 1 when subarea s is allocated to product p in period t; f s pt = 0 otherwise. Giving the nomenclature and the schematic stockyard structure (Figures 1-3 Subject to: e s p0 = 0 ∀ p ∈ P, s ∈ S l s pt f s pt − e s pt ≥ 0 ∀ p ∈ P, s ∈ S, t ∈ T (9) X r pt , Y r p pt , Z r pp t , IR pt , IP pt , e s pt ≥ 0 ∀ r ∈ R, p ∈ P, p ∈ P, t ∈ T, s ∈ S The objective function (1) minimizes the total energy cost in the various stages of moving the ore within the stockyard along a planning horizon. The first three terms minimize the energy cost of using each route in a determined time. The fourth is the energy cost to keep the ore stored in the stockyard. The fifth is the wasted energy cost to retain the metal at the unloading terminal. The last two are the energy cost to change a product to meet unexpected demands. The decision variables are the following: the transportation times of products through the different routes of the stockyard at each period, considering a set of routes shared by some stockyard equipment; the amount of product in the unloading terminal not delivered at the end of each period; the amount of products stored in the stockyard subareas; and an indication of the empty or busy status of these subareas.
Constraint (2) ensures that the sums of the iron ore transportation times in all routes shared by each stockyard equipment are lower than the available time to serve this set of routes in a given period. In the same way, Constraint (3) ensures that the total flow of the iron ore transported in all routes shared by each item of stockyard equipment is lower than its flow capacity in a given period. Equations (4) and (6) ensure the mass balance between the supplier and the demand in the unload terminal and berth in each period, respectively. The amount of product not unloaded in the reception terminal measures the system's efficiency. Constraint (5) indicates that the unloading terminal is empty in the initial planning period. Constraint (7) is the mass balance equation in the stockyard, i.e., the stockpile volume in the next period will be equal to the volume of the current stockpile plus the flow of staked products minus the flow of reclaimed products in the same stockpile during the actual period. Equation (8) guarantees that the initial stockpile is empty.
Equation (9) limits the capacity of the stockpile by the stockyard subarea capacity of each product. Equation (10) indicates that each stockpile will receive only the designated product in a given period. Finally, Constraints (11) and (12) enforce the binary and nonnegativity restrictions on the corresponding decision variables.

Linear Relaxation-Based Heuristic
The LRBH algorithm is based on the proposal in [27] and involves successive relaxations to determine a possible solution for the model. The proposal consists of linear relaxation by replacing the integrality constraint with its continuous counterpart. This technique can find a near-optimal solution after some iterations of solving. It is possible to reach a fractional solution after each round and the technique will not stop without finding an integer solution. Between iterations, constraints with new bounds for the changed variables will be added to the model. In this paper, the algorithm works in two phases (see Figure 4). In the first phase, the mathematical model is relaxed, excluding constraints (11), which includes the binary constraints. Moreover, it includes Equation (13) as a limit for the decision variables that were previously binary: the following: the transportation times of products through the different routes of the stockyard at each period, considering a set of routes shared by some stockyard equipment; the amount of product in the unloading terminal not delivered at the end of each period; the amount of products stored in the stockyard subareas; and an indication of the empty or busy status of these subareas. Constraint (2) ensures that the sums of the iron ore transportation times in all routes shared by each stockyard equipment are lower than the available time to serve this set of routes in a given period. In the same way, Constraint (3) ensures that the total flow of the iron ore transported in all routes shared by each item of stockyard equipment is lower than its flow capacity in a given period.
Equations (4) and (6) ensure the mass balance between the supplier and the demand in the unload terminal and berth in each period, respectively. The amount of product not unloaded in the reception terminal measures the system's efficiency. Constraint (5) indicates that the unloading terminal is empty in the initial planning period. Constraint (7) is the mass balance equation in the stockyard, i.e., the stockpile volume in the next period will be equal to the volume of the current stockpile plus the flow of staked products minus the flow of reclaimed products in the same stockpile during the actual period. Equation (8) guarantees that the initial stockpile is empty.
Equation (9) limits the capacity of the stockpile by the stockyard subarea capacity of each product. Equation (10) indicates that each stockpile will receive only the designated product in a given period. Finally, Constraints (11) and (12) enforce the binary and nonnegativity restrictions on the corresponding decision variables.

Linear Relaxation-Based Heuristic
The LRBH algorithm is based on the proposal in [27] and involves successive relaxations to determine a possible solution for the model. The proposal consists of linear relaxation by replacing the integrality constraint with its continuous counterpart. This technique can find a near-optimal solution after some iterations of solving. It is possible to reach a fractional solution after each round and the technique will not stop without finding an integer solution. Between iterations, constraints with new bounds for the changed variables will be added to the model. In this paper, the algorithm works in two phases (see Figure 4). In the first phase, the mathematical model is relaxed, excluding constraints (11), which includes the binary constraints. Moreover, it includes Equation (13) as a limit for the decision variables that were previously binary: During phase 2, an inappropriate set variable may result in infeasible solutions [27]. After relaxation, the model is solved as an LP; then, the solution found is analyzed to determine the values reached for . This analysis consists of checking how many were given values greater than the limit. In turn, this limit will indicate how fast this technique will run. According to [27], the limit is In the first phase, the algorithm rewrites the model as LP and solves it. In phase two, the code fixes the model to indicate after the iterations an integer and possible solution to the problem. (the largest variable without a product designated to stockpile the variable has to be higher than 0). [27]. After relaxation, the model is solved as an LP; then, the solution found is analyzed to determine the values reached for f s pt . This analysis consists of checking how many f s pt were given values greater than the limit. In turn, this limit will indicate how fast this technique will run. According to [27], the limit is the highest value among all f s pt values. In this case, the technique will be set only one variable for the iteration and the LRBH is too slow. However, we overcame this problem by proposing a new parameter as a limit. If the limit is near to 0.5 (but never less than 0.5), the number of iterations could be less, but the solution may be too far from the optimal solution. After some rounds of calibration, we chose to use the value of 0.7 as the limit. If the limit is less than 0.5 in the first round, the constraint set by Equation (10) could be violated.

During phase 2, an inappropriate set variable may result in infeasible solutions
In the second phase, if the variables f s pt are higher or equal to the limit, it will be set as designated stockpile-that is, in the next iteration, they will be added into the model as constraints, as shown in Equation (14): Then, an iterative process is performed until all the stockpiles required are allocated. In this phase, we check the last linear programming (LP) model solution and set (variable assumes 1) the largest variable lower than the limit as used. In this step, it is necessary to simultaneously verify if any product is designated in the stockpile. The reason that the highest value lower than the limit is also set as used is that the model determines that its occupation will be less than the limit that the stockpile requires to be allocated to meet the demand from the berths. It is important that all demands be attempted, so this stockpile should be formed regardless. Then, the technique will perform the same procedure for the largest value of the variables lower than the limit (see Figure 5).
Energies 2020, 13, x FOR PEER REVIEW 10 of 18 the highest value among all values. In this case, the technique will be set only one variable for the iteration and the LRBH is too slow. However, we overcame this problem by proposing a new parameter as a limit. If the limit is near to 0.5 (but never less than 0.5), the number of iterations could be less, but the solution may be too far from the optimal solution. After some rounds of calibration, we chose to use the value of 0.7 as the limit. If the limit is less than 0.5 in the first round, the constraint set by Equation (10) could be violated.
In the second phase, if the variables are higher or equal to the limit, it will be set as designated stockpile-that is, in the next iteration, they will be added into the model as constraints, as shown in Equation (14): Then, an iterative process is performed until all the stockpiles required are allocated. In this phase, we check the last linear programming (LP) model solution and set (variable assumes 1) the largest variable lower than the limit as used. In this step, it is necessary to simultaneously verify if any product is designated in the stockpile. The reason that the highest value lower than the limit is also set as used is that the model determines that its occupation will be less than the limit that the stockpile requires to be allocated to meet the demand from the berths. It is important that all demands be attempted, so this stockpile should be formed regardless. Then, the technique will perform the same procedure for the largest value of the variables lower than the limit (see Figure 5). If after the model is solved, and at end of the iteration, all variables are 0 or 1 (that is, an existing solution or feasible solution occurs), then the heuristic stops and presents that solution. If there are some fractional variables, then the process returns to the beginning of phase 2. Algorithm 1 presents the basic structure of the LRNH for this IOSEP problem. If after the model is solved, and at end of the iteration, all variables f s pt are 0 or 1 (that is, an existing solution or feasible solution occurs), then the heuristic stops and presents that solution. If there are some fractional variables, then the process returns to the beginning of phase 2. Algorithm 1 presents the basic structure of the LRNH for this IOSEP problem. In this IOSEP problem, the most important feature is the presence of the energy cost as the main strategy to achieve the efficiency of this system. In the same way as in Table 1, this problem is summarized in Table 3.

Physical Characteristics of the Iron Ore Stockyard Proposal
The verification and validation procedures for the model proposed in this study were performed with the aid of the commercial solver-CPLEX 12.5 [9]. Random values were used to define the demand of each ship and create simulated instances using parameters based on those in [9,24].
The experiments were performed on an Intel Core i5, 3.2 GHz processor with 8 Gb of RAM. Tables 4 and 5 present information about the parameters and sets of instances created for the purpose of comparisons between them. Each parameter of the instances lies in a range whose maximum and minimum values are determined from a uniform random choice. In turn, the instances are defined based on the size of the problem. By increasing the planning horizon and the different types of iron ore or products stored in the stockyard, it is expected that the complexity will increase until the methodology is no longer practical. We separated the instances according to their sizes. First, we increased the number of products and periods over the short term; in turn, for instances 6-16 we increased the amount of products and periods to be evaluated until the MILP mathematical model and the LRBH could feasibly solve this IOSEP (See Table 6). The authors in [27] did not stipulate a minimum value of iterations for the convergence of the solutions, making only one change in the heuristic at each iteration in the largest value found, or when the LP solution assumes 1 to the previous binary variable. Despite being a viable technique and indicating a greater possibility of proximity with the optimal solution, the number of iterations becomes even greater as the problem increase by number of periods.
Thus, we included the possibility of using a lower bound to set the stockpile used after each LP round. After some tests with small instances, we selected the limit value of 0.7 which will improve the LRBH efficiency (computational effort) after the first round by shrinking the number of iterations that are needed for only the full stockpile ( f s pt = 1) or the largest values of these variables.

Computational Results
From this analysis and considering MILP mathematical model (1)- (10) and the LP mathematical model (deleting (11) and adding (13)), the information contained in Tables 4 and 5 was used to create the various instances. For this purpose, that, we wrote a code in the Python programming language to generate the input data, and we wrote the model in an adequate format for the CPLEX [9] to perform the optimization of each of the scenarios, using the standard settings of this solver. This code in the Python language applies the library package CPLEX to run the LP and MILP and also to facilitate the procedures of the LRBH that use the CPLEX and its functions as part of the code. Table 7 shows the computational effort measured in seconds (or fraction of seconds) for the CPLEX solver to indicate the optimal solution or the proposal of a solution using LRBH for each instance using the GAP (as set in Equation (15)) to compare two different optimization techniques, where technique 1 has an objective function larger than technique 2.

GAP =
Ob jective Function Technique 1 − Ob jective Function Technique 2 Ob jective Function Technique 1 (15) Table 7 shows the column GAP-LRBH/MILP, where Equation (15) was used to compare the LRBH solution with the optimal solution for each instance proposed.
Considering a restricted planning horizon limited to the number of ships and the equipment capacity, the mathematical model was sufficient to solve the problem in an optimal way via CPLEX 12.5 [9] for instances 1-13. Thus, MILP can solve this problem size, although real cases present a greater horizon of planning and a large number of request products.
Starting from instance 14, the commercial solver was not sufficient to find a solution due to out of memory. It is recommended that the planner use a more robust machine to obtain this solution or consider other techniques that may indicate a solution to the problems or even for more complex instances. In turn, LRBH achieved solutions to the problem up to instance 15, although the computational effort up to instance 13 was greater than that for MILP. The LRBH technique allowed us to find solutions with significant proximity to the optimal solution, especially for larger instances. This is an important factor for enabling the use of the technique in larger problems that cannot be solved by MILP.
The stockyard scheme used in all instances can be observed in Figure 6. The routes and subsets of routes are designated with the source and are also labeled with a number. Table 7 shows the column GAP-LRBH/MILP, where Equation (15) was used to compare the LRBH solution with the optimal solution for each instance proposed.
Considering a restricted planning horizon limited to the number of ships and the equipment capacity, the mathematical model was sufficient to solve the problem in an optimal way via CPLEX 12.5 [9] for instances 1-13. Thus, MILP can solve this problem size, although real cases present a greater horizon of planning and a large number of request products.
Starting from instance 14, the commercial solver was not sufficient to find a solution due to out of memory. It is recommended that the planner use a more robust machine to obtain this solution or consider other techniques that may indicate a solution to the problems or even for more complex instances. In turn, LRBH achieved solutions to the problem up to instance 15, although the computational effort up to instance 13 was greater than that for MILP. The LRBH technique allowed us to find solutions with significant proximity to the optimal solution, especially for larger instances. This is an important factor for enabling the use of the technique in larger problems that cannot be solved by MILP.
The stockyard scheme used in all instances can be observed in Figure 6. The routes and subsets of routes are designated with the source and are also labeled with a number. Figure 6. Stockyard scheme used in all instances; 1 means that route 1 is in subset of routes that will bring to the stockpile products from reception; then, the subset of routes contains routes 1, 2, 3 and 4. The same happen for the subsets of routes and . In this scheme, the authors have two Figure 6. Stockyard scheme used in all instances; 1 x means that route 1 is in subset of routes X that will bring to the stockpile products from reception; then, the subset of routes X contains routes 1, 2, 3 and 4. The same happen for the subsets of routes Y and Z. In this scheme, the authors have two stockpiles in the stockyard and three berths. When f 1 pt = 1, the authors indicate that stockpile will be used, otherwise f 1 pt = 0. Figure 7 shows the product designation (1 or 2) for each stockpile during the three periods of instance 1. After designating the product, the flows upstream and downstream will be limited only for this product or a changed blend using this product.
Energies 2020, 13, 5232 14 of 18 stockpiles in the stockyard and three berths. When = 1, the authors indicate that stockpile will be used, otherwise = 0. Figure 7 shows the product designation (1 or 2) for each stockpile during the three periods of instance 1. After designating the product, the flows upstream and downstream will be limited only for this product or a changed blend using this product. For a visual comparison, the LRBH starts by relaxing the MILP model and including a lower and upper bound to the binary variables. After these procedures, the LP is solved, and the solution is reached for this first LP round for the instance illustrated in Figure 8. This step shows how to set these variables to 1. Figure 8. Process of setting to 1 the variables found after the first LP round. The green circles are the variable set to 1 because they are larger than the limit (0.7), and the red circle is the variable that will be set to 1 because it is the largest variable below the limit.
After setting the binary variables to 1, the model is updated with this information and the LP model is solved again. For instance 1, a solution for the IOSEP problem is found in this iteration (see Figure 9). In Figure 8, all stockpiles have a designated product in this round, so it is expected to find a solution in the next round. If there were another product designated to the stockpile 2 in period 2, it would be impossible to ensure the solution in the next iteration, because the constraint (10) would not be satisfied. Figure 9. After setting to 1 some variables, there was another LP round with changes, and a possible solution of this IOSEP problem was found. When product 1 is designated to stockpile, the variable is blue, otherwise, if product 2 is designated to stockpile, the variable is red. Figure 7. The values inside the boxes are the solution of the binary variables from MILP model. When product 1 is designated to stockpile, the variable is blue, otherwise, if product 2 is designated to stockpile, the variable is red.
For a visual comparison, the LRBH starts by relaxing the MILP model and including a lower and upper bound to the binary variables. After these procedures, the LP is solved, and the solution is reached for this first LP round for the instance illustrated in Figure 8. This step shows how to set these variables to 1.
stockpiles in the stockyard and three berths. When = 1, the authors indicate that stockpile will be used, otherwise = 0. Figure 7 shows the product designation (1 or 2) for each stockpile during the three periods of instance 1. After designating the product, the flows upstream and downstream will be limited only for this product or a changed blend using this product. For a visual comparison, the LRBH starts by relaxing the MILP model and including a lower and upper bound to the binary variables. After these procedures, the LP is solved, and the solution is reached for this first LP round for the instance illustrated in Figure 8. This step shows how to set these variables to 1. Figure 8. Process of setting to 1 the variables found after the first LP round. The green circles are the variable set to 1 because they are larger than the limit (0.7), and the red circle is the variable that will be set to 1 because it is the largest variable below the limit.
After setting the binary variables to 1, the model is updated with this information and the LP model is solved again. For instance 1, a solution for the IOSEP problem is found in this iteration (see Figure 9). In Figure 8, all stockpiles have a designated product in this round, so it is expected to find a solution in the next round. If there were another product designated to the stockpile 2 in period 2, it would be impossible to ensure the solution in the next iteration, because the constraint (10) would not be satisfied. Figure 9. After setting to 1 some variables, there was another LP round with changes, and a possible solution of this IOSEP problem was found. When product 1 is designated to stockpile, the variable is blue, otherwise, if product 2 is designated to stockpile, the variable is red. Figure 8. Process of setting to 1 the variables found after the first LP round. The green circles are the variable set to 1 because they are larger than the limit (0.7), and the red circle is the variable that will be set to 1 because it is the largest variable below the limit.
After setting the binary variables to 1, the model is updated with this information and the LP model is solved again. For instance 1, a solution for the IOSEP problem is found in this iteration (see Figure 9). In Figure 8, all stockpiles have a designated product in this round, so it is expected to find a solution in the next round. If there were another product designated to the stockpile 2 in period 2, it would be impossible to ensure the solution in the next iteration, because the constraint (10) would not be satisfied.
stockpiles in the stockyard and three berths. When = 1, the authors indicate that stockpile will be used, otherwise = 0. Figure 7 shows the product designation (1 or 2) for each stockpile during the three periods of instance 1. After designating the product, the flows upstream and downstream will be limited only for this product or a changed blend using this product. For a visual comparison, the LRBH starts by relaxing the MILP model and including a lower and upper bound to the binary variables. After these procedures, the LP is solved, and the solution is reached for this first LP round for the instance illustrated in Figure 8. This step shows how to set these variables to 1. Figure 8. Process of setting to 1 the variables found after the first LP round. The green circles are the variable set to 1 because they are larger than the limit (0.7), and the red circle is the variable that will be set to 1 because it is the largest variable below the limit.
After setting the binary variables to 1, the model is updated with this information and the LP model is solved again. For instance 1, a solution for the IOSEP problem is found in this iteration (see Figure 9). In Figure 8, all stockpiles have a designated product in this round, so it is expected to find a solution in the next round. If there were another product designated to the stockpile 2 in period 2, it would be impossible to ensure the solution in the next iteration, because the constraint (10) would not be satisfied. Figure 9. After setting to 1 some variables, there was another LP round with changes, and a possible solution of this IOSEP problem was found. When product 1 is designated to stockpile, the variable is blue, otherwise, if product 2 is designated to stockpile, the variable is red. Figure 9. After setting to 1 some variables, there was another LP round with changes, and a possible solution of this IOSEP problem was found. When product 1 is designated to stockpile, the variable is blue, otherwise, if product 2 is designated to stockpile, the variable is red.
In problems where the object function is minimization, solving the linear relaxation gives a lower bound of the optimal value of the MILP [27]. The values from instance 1 to instance 13 indicate that the optimal solution for each instance is always between the LP solution and LRBH. The cases from instance 14 onwards can evaluated using Equation (15) to compare the solutions from MILP and LRBH with the LP solution (See Table 8). The solution quality assessment can be verified with the LRBH using the GAP between the heuristic and the LP solutions, because this metric assumes an even lower value over the course of increasing the size of the instances. In this way, if the GAP between LRBH and LP decreases, the solution from LRBH will always tend to be closer to the MILP solution. In instances 14 and 15, the optimal solutions have GAPs of up to 0.000008% and 0.000004%, respectively, guaranteeing the good quality of the solution, since the technique finishes by a possible solution to the problem.
Instance 1 also presents different behavior to the others when the GAP is larger than the other instances; for a very small instance, it does not present satisfactory results. In the other instances, the results achieved gradually approached the optimal solution, indicating a convergence with the use of the technique (see Figure 10).
Energies 2020, 13, x FOR PEER REVIEW 15 of 18 In problems where the object function is minimization, solving the linear relaxation gives a lower bound of the optimal value of the MILP [27]. The values from instance 1 to instance 13 indicate that the optimal solution for each instance is always between the LP solution and LRBH. The cases from instance 14 onwards can evaluated using Equation (15) to compare the solutions from MILP and LRBH with the LP solution (See Table 8). The solution quality assessment can be verified with the LRBH using the GAP between the heuristic and the LP solutions, because this metric assumes an even lower value over the course of increasing the size of the instances. In this way, if the GAP between LRBH and LP decreases, the solution from LRBH will always tend to be closer to the MILP solution. In instances 14 and 15, the optimal solutions have GAPs of up to 0.000008% and 0.000004%, respectively, guaranteeing the good quality of the solution, since the technique finishes by a possible solution to the problem.
Instance 1 also presents different behavior to the others when the GAP is larger than the other instances; for a very small instance, it does not present satisfactory results. In the other instances, the results achieved gradually approached the optimal solution, indicating a convergence with the use of the technique (see Figure 10).  An important observation for the verification of the results is that the planning must be done properly in order to avoid waiting for the receipt of excess inputs with the related energy expenditures for maintenance at reception or energy expenditures due to an alteration of the characteristics of a product to meet demand.
Likewise, these results highlight periods of the planning horizon that are more favorable for the procedures to be carried out, indicating the feasibility of using this model for small problems and LRBH for large problems, such as instances 14 and 15, that cannot be resolved using MILP.
In general, analysis of the use of MILP or LRBH considers the possibility that a company will carry out planning and re-planning with a reduced time horizon to maintain an optimal solution at all times or with good quality, considering any changes that may occur during a period. In this way, these techniques could be used by the planner to make decisions in the short, medium, or long term.

Conclusions
Due to the importance of defining the energetic planning and scheduling of activities for an iron ore stockyard-port system including various types of ore with different characteristics, this paper presented an MILP model adapted to the energy sector and an LRBH to solve this problem. In addition, this model considers the minimization of energetic costs, thus preventing this system from becoming inefficient.
For the complexity of the problem to be considered, variations between instances were addressed along with increase in products and the planning horizon for the problem. The performance of the exact technique was assessed by comparing these different sizes of instances and techniques.
A technique was developed by relaxing and setting the variables to solve the problem as fast as possible. This method was adapted to the IOSEP problem in the context of supply chain design and focused on finding a feasible solution to problems that the MILP cannot solve due to computational limitations. Two different rules were used to reach the solution: the minimum value of the limit and the largest fractional value lower than the limit.
The mathematical model adapted from [24] to solve stockyard planning problem while minimizing the energy cost allowed this problem to be solved optimally for instances 1 to 13. Despite the LRBH reaching a solution, for these instances, the mathematical model was able to find the optimal solution for this problem. In other words, the decision maker can be assured that a decision with this technique would propose planning with the minimum energy costs for the problem. In this way, for some cases (Instances 1 to 13) commercial solvers such as CPLEX 12.5 [9] are able to solve the problem with satisfactory computational time, considering the complexity of the decision making that must be made. The LRBH was able to solve instances 1 to 15 and reach solutions close to the optimal solution of the problem in instances 2 to 13, showing that this technique provides a satisfactory result.
On the other hand, for instances 1 to 13, the LRBH found a solution with a 3.99% average GAP with respect to the MILP solution. If one considers only instances 2 to 13, this value reaches approximately 0.47%. Further, considering Tables 7 and 8, the values of GAP shrink as the instances become larger. Instances 14 and 15 were not solved using MILP. For this reason, we compared using the GAP between the LP model and the LRBH. Even though the MILP was not able to reach the optimal solution, it is possible to ensure that the GAP between MILP and LP is equal to or smaller than the GAP between LP and LRBH once the MILP objective function is equal to or larger than the LP objective function and less than or equal to the LRBH objective function.
The solution reached by LRBH for instances 14 and 15 presented a 0.000012% average GAP. Since the objective function of this problem is related to the energy cost, it is able to ensure that the energy cost of the planning using LRBH will not be larger than the GAP of each instance. Thus, the extra cost of using LRBH for larger instances is a value close to 0-that is, the solution reached will be close to the optimal solution and indicate a low-cost solution for the decision makers.
Thus, this work presented a mathematical model and a linear relaxation-based heuristic as tools that can help decision-making agents find a solution quickly with information on the patio-port system. However, even larger problems (instance 16) can be solved using specific techniques, as the CPLEX process was interrupted due to being out of memory, and the heuristic was interrupted due to exceeding 20,000 s. In these cases, future research may focus on techniques such as other heuristics and metaheuristics, e.g., simulated annealing, the genetic algorithm or column generation, to provide adequate solutions to the problem, or even a computer with more memory and a more robust processor. Furthermore, the LRBH could be employed as a technique to find an initial solution using sophisticated procedures with heuristics and metaheuristics to solve instance 16 and even larger instances. With these improvements, the largest instances from instance 16 could be solved efficiently, and we could also consider the uncertainty of demand under a multi-objective approach that promotes research with both business interests and practical relevance.
Moreover, more robust models could be developed that consider changing organizational objectives during a company's journey alongside important characteristics such as inventory turnover, in addition to adding different types of ore to the mix in the mine to form different products (types of ore) in the stockyard.
In addition, future studies could include an analysis of the performance of the solver by evaluating changes in the settings of the solver as options for reducing the memory usage to expand the size of the instances and improve the process.