Example: Make or Buy

The solver uses ranks to determine business preferences when multiple sourcing options exist

About Example

Sometimes a business has multiple sourcing options:

This example shows how the solver uses ranks to pick how to supply demand when multiple options exists. The bakery in this example prefers to bake their pies fresh and buy their oven directly from home depot.

Video Nodes

Data Notes


bom_ids

bom_id location lead_time_days activity_rank note
apple_pie bakery 5 1.0 prefert to bake pie
oven bakery 365 NaN prefer to buy oven

bom_inputs

bom_id input_item input_qty
apple_pie sugar 0.50
apple_pie flour 2.00
apple_pie water 0.05
apple_pie butter 0.25
apple_pie apples 1.00
oven metal 6.00
oven legs 4.00
oven glass 1.00
oven burners 4.00
oven display 1.00
overn hardware 200.00

bom_outputs

bom_id output_item output_qty
apple_pie apple_pie 1
oven oven 1

demand

location item need_date demand_qty
bakery apple_pie 5/30/2024 100
bakery oven 5/29/2024 1

item_location

item location genesis
sugar Sysco True
flour Sysco True
water Sysco True
butter Sysco True
apples Sysco True
apple_pie Sysco True
metal Home Depot True
legs Home Depot True
glass Home Depot True
burners Home Depot True
display Home Depot True
hardware Home Depot True
oven Home Depot True

lanes

item from_location to_location lead_time_days activity_rank note
sugar Sysco bakery 2 1.0 NaN
flour Sysco bakery 2 NaN assume blank has no impact as there is no other option
water Sysco bakery 2 1.0 NaN
butter Sysco bakery 2 1.0 NaN
apples Sysco bakery 2 1.0 NaN
apple_pie Sysco bakery 2 2.0 this should not be picked
metal Home Depot bakery 2 1.0 NaN
legs Home Depot bakery 2 1.0 NaN
glass Home Depot bakery 2 1.0 NaN
burners Home Depot bakery 2 2.0 assume 2 has no impact as there is no other option
display Home Depot bakery 2 1.0 NaN
hardware Home Depot bakery 2 1.0 NaN
oven Home Depot bakery 5 1.0 this should be picked

item_location_peggings

item location activity activity_date pegged_qty demand_key
sugar Sysco 0_item_genesis 2024-05-23 50.0 0
flour Sysco 0_item_genesis 2024-05-23 200.0 0
water Sysco 0_item_genesis 2024-05-23 5.0 0
butter Sysco 0_item_genesis 2024-05-23 25.0 0
apples Sysco 0_item_genesis 2024-05-23 100.0 0
sugar Sysco 7_shipment_from 2024-05-23 50.0 0
flour Sysco 7_shipment_from 2024-05-23 200.0 0
water Sysco 7_shipment_from 2024-05-23 5.0 0
butter Sysco 7_shipment_from 2024-05-23 25.0 0
apples Sysco 7_shipment_from 2024-05-23 100.0 0
oven Home Depot 0_item_genesis 2024-05-24 1.0 1
oven Home Depot 7_shipment_from 2024-05-24 1.0 1
sugar bakery 2_shipment_to 2024-05-25 50.0 0
flour bakery 2_shipment_to 2024-05-25 200.0 0
water bakery 2_shipment_to 2024-05-25 5.0 0
butter bakery 2_shipment_to 2024-05-25 25.0 0
apples bakery 2_shipment_to 2024-05-25 100.0 0
sugar bakery 6_BOM_input 2024-05-25 50.0 0
flour bakery 6_BOM_input 2024-05-25 200.0 0
water bakery 6_BOM_input 2024-05-25 5.0 0
butter bakery 6_BOM_input 2024-05-25 25.0 0
apples bakery 6_BOM_input 2024-05-25 100.0 0
oven bakery 2_shipment_to 2024-05-29 1.0 1
apple_pie bakery 3_BOM_output 2024-05-30 100.0 0

shipments

level from_location to_location item ship_date arrival_date shipment_qty demand_key
1 Home Depot bakery oven 2024-05-24 2024-05-29 1.0 1
3 Sysco bakery apples 2024-05-23 2024-05-25 100.0 0
6 Sysco bakery butter 2024-05-23 2024-05-25 25.0 0
9 Sysco bakery water 2024-05-23 2024-05-25 5.0 0
12 Sysco bakery flour 2024-05-23 2024-05-25 200.0 0
15 Sysco bakery sugar 2024-05-23 2024-05-25 50.0 0

Loading Supply Chain Network from Files
Running obo Solver
***Starting to plan for demand key 0***
At bakery on 2024-05-30: Searching inventory for 100 units of apple_pie
At bakery: No inventory for apple_pie
At bakery: Searching rank 1.0 BomOutputEdge BOM-apple_pie to apple_pie-bakery with LT 5.0 days
--At BOM apple_pie input 1/5: Searching for 50.0 of sugar
----At bakery on 2024-05-25: Searching inventory for 50.0 units of sugar
----At bakery: No inventory for sugar
----At bakery: Searching rank 1.0 BodEdge sugar-Sysco to sugar-bakery with LT 2.0 days
------At Sysco on 2024-05-23: Genesis Node for sugar. All 50.0 need satisfied
----At bakery: Found 50.0/50.0 on edge sugar-Sysco to sugar-bakery
----At bakery: Found all supply. Done searching edges of sugar-bakery
--At BOM apple_pie input 1/5: Found all supply for sugar
--At BOM apple_pie input 2/5: Searching for 200.0 of flour
----At bakery on 2024-05-25: Searching inventory for 200.0 units of flour
----At bakery: No inventory for flour
----At bakery: Searching BodEdge flour-Sysco to flour-bakery with LT 2.0 days
------At Sysco on 2024-05-23: Genesis Node for flour. All 200.0 need satisfied
----At bakery: Found 200.0/200.0 on edge flour-Sysco to flour-bakery
----At bakery: Found all supply. Done searching edges of flour-bakery
--At BOM apple_pie input 2/5: Found all supply for flour
--At BOM apple_pie input 3/5: Searching for 5.0 of water
----At bakery on 2024-05-25: Searching inventory for 5.0 units of water
----At bakery: No inventory for water
----At bakery: Searching rank 1.0 BodEdge water-Sysco to water-bakery with LT 2.0 days
------At Sysco on 2024-05-23: Genesis Node for water. All 5.0 need satisfied
----At bakery: Found 5.0/5.0 on edge water-Sysco to water-bakery
----At bakery: Found all supply. Done searching edges of water-bakery
--At BOM apple_pie input 3/5: Found all supply for water
--At BOM apple_pie input 4/5: Searching for 25.0 of butter
----At bakery on 2024-05-25: Searching inventory for 25.0 units of butter
----At bakery: No inventory for butter
----At bakery: Searching rank 1.0 BodEdge butter-Sysco to butter-bakery with LT 2.0 days
------At Sysco on 2024-05-23: Genesis Node for butter. All 25.0 need satisfied
----At bakery: Found 25.0/25.0 on edge butter-Sysco to butter-bakery
----At bakery: Found all supply. Done searching edges of butter-bakery
--At BOM apple_pie input 4/5: Found all supply for butter
--At BOM apple_pie input 5/5: Searching for 100.0 of apples
----At bakery on 2024-05-25: Searching inventory for 100.0 units of apples
----At bakery: No inventory for apples
----At bakery: Searching rank 1.0 BodEdge apples-Sysco to apples-bakery with LT 2.0 days
------At Sysco on 2024-05-23: Genesis Node for apples. All 100.0 need satisfied
----At bakery: Found 100.0/100.0 on edge apples-Sysco to apples-bakery
----At bakery: Found all supply. Done searching edges of apples-bakery
--At BOM apple_pie input 5/5: Found all supply for apples
--At BOM apple_pie: Done searching all inputs
At bakery: Found 100/100 on edge BOM-apple_pie to apple_pie-bakery
At bakery: Found all supply. Done searching edges of apple_pie-bakery
***Found 100.00% supply for demand key 0***
***Starting to plan for demand key 1***
At bakery on 2024-05-29: Searching inventory for 1 units of oven
At bakery: No inventory for oven
At bakery: Searching rank 1.0 BodEdge oven-Home Depot to oven-bakery with LT 5.0 days
--At Home Depot on 2024-05-24: Genesis Node for oven. All 1 need satisfied
At bakery: Found 1/1 on edge oven-Home Depot to oven-bakery
At bakery: Found all supply. Done searching edges of oven-bakery
***Found 100.00% supply for demand key 1***
Solver complete. Writing output

Created by Bill Ulrich
See the About page for more details