This paper addresses a real-life single-item dynamic lot sizing problem arising in a refinery for crude oil procurement. It can be considered as a lot sizing problem with bounded inventory. We consider two managerial policies. With one policy, a part of the demand of a period can be backlogged and with the other, a part of the demand of a period can be outsourced. We define actuated inventory bounds and show that any bounded inventory lot sizing model can be transformed into an equivalent model with actuated inventory bounds. The concept of actuated inventory bounds significantly contributes to the complexity reduction. In the studied models, the production capacity can be assumed to be unlimited and the production cost functions to be linear but with fixed charges. The results can be easily extended to piecewise linear concave production cost functions. The goal is to minimize the total cost of production, inventory holding and backlogging, or outsourcing. We show that the backlogging model can be solved in O(T <sup xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink">2</sup> ) time with general concave inventory holding and backlogging cost functions where T is the number of periods in the planning horizon. The complexity is reduced to O(T) when the inventory/backlogging cost functions are linear and there is no speculative motives to hold either inventory or backlogging. When the outsourcing levels are unbounded, we show that the outsourcing model can be transformed into an inventory/backlogging model. As a consequence, the problem can be solved in O(T <sup xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink">2</sup> ) time, if the outsourcing cost functions are linear with fixed charges even if the inventory holding cost functions are general concave functions. When the outsourcing level of a period is bounded from above by the demand of the period, which is the case in many application areas, we show that the outsourcing model can be solved in O(T <sup xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink">2 </sup> logT) time if the inventory holding and the outsourcing cost functions are linear. Note to Practitioners-This paper considers dynamic lot-sizing models with bounded inventory and outsourcing or backlogging decisions. Based on the forecasted requirements of a given item for each period of the planning horizon, the problem consists of determining the quantity to be produced inhouse or to be ordered from a supplier and the quantity to be outsourced in each period to minimize a total cost over the considered planning horizon, composed of the production or purchasing cost, inventory holding cost, and the backlogging cost or the outsourcing cost. These problems initially come from real-life crude oil procurement and often arise in many companies. In this paper, we consider two models. In one model, backlogging is allowed with a backlogging penalty while there is no possibility of outsourcing. In the other model, all of the customer requirements are satisfied in time (i.e., without backlogging) but outsourcing is possible. For each model, we develop an algorithm to find an optimal solution. The computation time of these algorithms can be bounded by a one or two degree polynom of the number of periods in the planning horizon, which means that the computation time required to find an optimal solution is very short