Creating environment friendly provide chains is likely one of the best challenges of the 2020s—and never simply due to the disruptions led to by the COVID-19 pandemic. Provide chains had been strained earlier than the pandemic because of international bottlenecks and shortages in labor and tools. To maintain up with demand, market gamers should quickly modernize enterprise processes via digitization and clever planning.
My profession as a developer and information science guide is targeted on heavy business: rail, mining, oil and fuel, delivery, and postal logistics. All of those sectors have been vastly impacted by provide chain points over these previous couple of years. On this piece, I discover how mathematical optimization modeling and Python can resolve a core problem within the coal mining business: satisfying personalized demand and maximizing revenue via product mixing.
An Optimization Method for the Trendy Provide Chain
Within the typical provide chain situation, a provider delivers a selected completed product to a buyer. In our instance, to perform this, a provider should:
- Collect the required parts from a number of supply places (e.g., manufacturing websites, warehouses).
- Mix the parts, executing a selected process to create a completed good. In a coal provide chain, that is known as product mixing.
- Ship the completed product to a single goal location (e.g., the client’s web site).
Carried out proper, product mixing permits the provider to maximise worth by leveraging trade-offs between buyer wants and the availability chain. Mathematical optimization modeling is the perfect answer for addressing product mixing together with logistical challenges corresponding to scheduling, planning, packing, and routing.
A graph theoretical method, like community circulation optimization, works effectively for challenges with a transparent restricted scope (e.g., asking Google Maps methods to get from A to B). However to deal with extra intricate challenges that influence overlapping facets of the availability chain (e.g., product mixing), mixed-integer programming is a robust framework. Quick, well-researched, and established, mixed-integer programming permits customers to deal with the overwhelming majority of scheduling, planning, and routing points.
To mannequin and resolve provide chain issues, I like to recommend utilizing Python and its open-source libraries because of their robust optimization communities.
Product Mixing in a Coal Provide Chain
For example of product mixing, let’s think about a coal provide chain that includes a number of mines and produces quite a lot of coal parts. Sometimes, these parts must be routed to seaports. To maintain our instance easy, we’ll hook up with only one seaport through a rail community that additionally hyperlinks the mines.
We’ll use the next phrases:
Part |
A element is a uncooked manufacturing merchandise (e.g., a sort of coal), sourced at a selected location. |
Product |
A product is a completed good, demanded and outlined by a buyer, sometimes containing a mix of parts and falling inside a said high quality vary. |
Mixing |
Mixing is the combining of parts to type a product, both on the goal location (sometimes, the client’s vessel) or sooner or later within the provide chain. |
Spec Assay |
A specification, or spec, assay is the measurement of a element property (e.g., moisture content material). Sometimes, engineers carry out about 20 to 100 assays, every of which assessments a unique property of the coal. |
Coal parts retrieved from mines are transported by rail to a port, with the client vessel as the ultimate vacation spot. Relying on the designated port’s berthing schedule or different circumstances, momentary storage of the parts at a stockpile could also be obligatory. On the port, the prepare will both deposit the load onto a stockpile or unload it immediately onto the client vessel (what we name a direct hit).
Parts are saved at mines and seaports. Mines are usually established in distant places the place cupboard space is affordable and plentiful. Ports, then again, exist in industrial areas that normally have restricted house, making port stockpiles costly to make use of.
Modeling Particulars
Our hypothetical buyer has demanded product blends that consist of various parts. These blends should conform to the related mineral property requirements, as outlined by the client (e.g., CSR worth). For instance how this mannequin can be constructed, let’s say that we now have three mines that produce seven parts, as follows:
Mine A |
Produces parts A1, A2, A3. |
Mine B |
Produces parts B1, B2. |
Mine C |
Produces parts C1, C4. |
The letter in a element’s identify signifies the element’s supply mine (e.g., element A3 was sourced at Mine A). Let’s agree that parts that share a quantity are related and as such, we could deal with them equivalently: For instance, A1, B1, and C1 are primarily the identical sort of coal.
All parts are transported by rail to the port, the place we will both carry out a direct hit or deposit every element at an acceptable stockpile. Area limitations could prohibit us from storing parts individually. As such, when mixing a product, we could not have entry to every element individually and should have to extract a number of parts from a single stockpile concurrently.
Now, let’s talk about the mixing guidelines that prospects sometimes demand for his or her merchandise.
Product Mixing Guidelines
Prospects routinely ask for a mix of parts per customer-specific guidelines on each how a mix could also be carried out and which spec assays are obligatory. Such guidelines fall into two classes, element mixing guidelines and spec mixing guidelines.
Description |
Instance |
||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Part Mixing Guidelines |
The proportion of every element that composes a product is outlined as a ratio or share of the entire. |
A product stockpile (aka blended stockpile) with the next breakdown:
|
|||||||||
Spec Mixing Guidelines |
Worth boundaries for a product are established for every outlined product property. Product properties are measured by spec assay. Values embrace:
|
The product in our earlier instance can be accepted with out penalty if:
|
Discover that, sometimes, the deviation penalty quantity will increase as a linear perform because the boundary violation grows:
The optimization of mixing consists of trade-offs between accepting penalties for spec mixing and the provision of parts.
When making a product mixing mannequin, we should select between completely different extraction varieties. For mixing, common extraction is the most typical extraction sort. In common extraction, we mannequin based mostly on an assumption that each one parts within the stockpile are completely combined collectively. Layered extraction, the place we mannequin utilizing a last-in, first-out rule, is a substitute for utilizing common extraction:
Common Extraction |
|
Layered Extraction |
|
The concept of layered extraction could also be interesting, because it carefully simulates the fact of the storing logistics at most stockpiles. Nevertheless, from a mathematical modeling perspective, common extraction is most well-liked for computational causes. The choice to make use of layered extraction ought to be rigorously evaluated by enterprise professionals and engineers, in order to keep away from introducing pointless problems right into a modeling method.
When utilizing common extraction, the proportions of extracted parts to 1 one other are equivalent to these of the unextracted parts. For instance, common extraction says that an extraction from stockpile X containing 75% of element A3 and 25% of element C4 accommodates the identical parts and the identical proportions as stockpile X in its entirety.
When layered extraction is used, the proportions of extracted parts to 1 one other are not often, if ever, equivalent to these of the unextracted parts. Layered extraction says that, for instance, an extraction from stockpile X wouldn’t essentially comprise the identical parts as stockpile X in its entirety, nor the identical proportions as stockpile X. It’s because we might be extracting no matter element(s) are on the prime of the stockpile (last-in, first-out).
The inconsistent nature of a layered extraction makes it tough to mannequin loading variables. Due to this fact, common extraction, which avoids complicated interdependencies between the loading variables, is the popular possibility when layered extraction isn’t a enterprise requirement (see additionally “Coding to Remedy Product Mixing”).
Product Mixing Modeling
Let’s think about the case of common extraction. Say we wish to monitor and mannequin parts deposited at a stockpile or buyer vessel. Listed here are three attainable extraction and modeling eventualities:
Situation 1: Single Extraction Modeling We are able to extract any/all parts, no matter sort. On this instance, we could deal with element A1 (sourced at Mine A) and B1 (sourced at Mine B) as if they’re the identical element as a result of they’re related sufficient. |
|
Situation 2: Product Mix Extraction Modeling We are able to extract a possible product mix. On this instance, the extracted product mix conforms to the client’s product mixing rule necessities:
|
|
Situation 3: Versatile Combine Extraction Modeling We are able to solely extract an invalid element combine that doesn’t conform to the client’s element mixing guidelines and thus doesn’t type a product by itself. On this instance, since our mix of parts A3 and C4 doesn’t type a sound product, we will:
|
|
From a modeling perspective, I like to recommend creating mixed-integer programming formulations to deal with product mixing. We are able to mannequin product mixing by utilizing solely real-valued variables and linear constraints, making it comparatively simple to calculate and monitor blends.
Issues can get difficult when product mixing modeling overlaps with scheduling choices that require binary variables for modeling functions, corresponding to choices round vessel berthing or prepare schedules.
Coding to Remedy Product Mixing
Python is right for coding and fixing mixed-integer programming formulations. Use the PuLP library to formulate provide chain issues, corresponding to defining variables, constraints, and goal features. Conveniently, PuLP’s syntax carefully resembles a clear mathematical formulation.
You possibly can then combine an open-source solver like Cbc or, in case your funds permits, a industrial solver like Gurobi or CPLEX. The industrial choices present an amazing efficiency enhance in comparison with Cbc.
The next pseudocode examples display how we outline loading variables and constraints. The loading variables are:
load[v=vessel, p=port, c=component, prd=product, t=time]
These variables have 5 indices: vessel, port, element, product, and time. In follow, you’ll outline many extra forms of loading variables.
Including a product index to the loading variables is beneficial for monitoring the particular product for which a element is designated. Since loading variables are actual values (versus integers), they don’t pose a giant computational problem. Part mixing guidelines can now be modeled as follows:
load[v, p, A2, prd, t] >= 0.5 * sum(load[v, p, c, prd, t] for all c that serve product prd of vessel v)
load[v, p, C1, prd, t] <= 0.2 * sum(load[v, p, c, prd, t] for all c that serve product prd of vessel v)
load[v, p, C1, prd, t] + load[v, p, B2, prd, t] <= 0.5 * sum(load[v, p, c, prd, t] for all c that serve product prd of vessel v)
Spec mixing guidelines might be applied with the same linear method. Nevertheless, these constraints can be a bit extra difficult, since spec assays are normally normalized by the loaded quantity. Whereas less complicated to execute, direct modeling would introduce non-linearities and, thus, can be impractical. As an alternative, it will be higher to calculate weighted pseudo-assay values after which reapply the linear equations. Caveat: The constraints could overlap with binary scheduling variables—however that dialogue is past the scope of this text.
I wholeheartedly advocate incorporating mixing guidelines right into a provide chain mannequin. My previous purchasers have had constant successes with optimized customer-specific mixing, which elevated the computational complexity of their scheduling fashions solely by a hair.
Reworking Your Coal Provide Chain to Incorporate Mixing
Product mixing is strongly related to rail and port operations, closely impacting day-to-day choices, corresponding to the place to move which parts or the place to deposit and/or extract parts.
The best digital state is a complete scheduling software that gives forward-looking suggestions for rail and port, with a mixing optimization mannequin built-in as a key half. When acceptable (e.g., to reply to altering climate situations), advert hoc problem-solving by approved rail and port operators can appropriate chosen suggestions.
For every distinctive provide chain, a customized scheduling software is smart. Utilizing an Agile course of, we may establish the influence of product mixing earlier than our full digital software is launched. Shut collaboration with operators and coordinators—always—would go a great distance towards addressing any change administration dangers.
To construction and code the fashions obligatory for constructing a scheduling utility, interact the skills of information scientists, information engineers, and optimization specialists. In right this moment’s difficult and aggressive setting, companies that implement product mixing keep forward of the competitors.
The editorial group of the Toptal Engineering Weblog extends its gratitude to John Lee for reviewing the code samples and different technical content material offered on this article.