Simple constrained inventory example showing solver handle limited available supply
This example is very similar to the One BOM example, except for the slight vairation that the flour supplier doesn't have infinite inventory. This causes the solver to have to handle the constraint of limited supply. In order to avoid over ordering water and yeast, the solver replans the bagel BOM node for only the percentage of available supply it can get of all inputs: 50%.
Does making 50% of a bagel really make sense? Probably not, but this is just an example!
| bom_id | location | lead_time_days |
|---|---|---|
| 1 | factory_1 | 5 |
| 2 | factory_1 | 10 |
| bom_id | input_item | input_qty |
|---|---|---|
| 1 | water | 1.0 |
| 1 | flour | 2.0 |
| 1 | yeast | 0.5 |
| bom_id | output_item | output_qty |
|---|---|---|
| 1 | bagel | 1 |
| location | item | need_date | demand_qty | note |
|---|---|---|---|---|
| store_1 | bagel | 5/30/2024 | 1.0 | NaN |
| factory_1 | water | 6/30/2024 | 0.5 | use this to check .5 inventory at factory exists for use |
| factory_1 | water | 6/30/2024 | 1.0 | this should not have inventory at factory 1 |
| item | location | genesis | onhand_qty | image |
|---|---|---|---|---|
| water | supplier_1 | True | NaN | water.png |
| flour | supplier_1 | False | NaN | flour.png |
| yeast | supplier_2 | True | NaN | yeast.png |
| water | factory_1 | False | 1.0 | water.png |
| flour | factory_1 | False | 1.0 | flour.png |
| yeast | factory_1 | False | 1.0 | yeast.png |
| bagel | factory_1 | False | NaN | bagel.png |
| bagel | store_1 | False | NaN | bagel.png |
| item | from_location | to_location | lead_time_days |
|---|---|---|---|
| bagel | factory_1 | store_1 | 5 |
| water | supplier_1 | factory_1 | 8 |
| flour | supplier_1 | factory_1 | 8 |
| yeast | supplier_2 | factory_1 | 8 |
| item | location | activity | activity_date | pegged_qty | demand_key |
|---|---|---|---|---|---|
| water | factory_1 | 5_BOH_usage | 2024-05-20 | 0.50 | 0 |
| flour | factory_1 | 5_BOH_usage | 2024-05-20 | 1.00 | 0 |
| yeast | factory_1 | 5_BOH_usage | 2024-05-20 | 0.25 | 0 |
| water | factory_1 | 6_BOM_input | 2024-05-20 | 0.50 | 0 |
| flour | factory_1 | 6_BOM_input | 2024-05-20 | 1.00 | 0 |
| yeast | factory_1 | 6_BOM_input | 2024-05-20 | 0.25 | 0 |
| bagel | factory_1 | 3_BOM_output | 2024-05-25 | 0.50 | 0 |
| bagel | factory_1 | 7_shipment_from | 2024-05-25 | 0.50 | 0 |
| bagel | store_1 | 2_shipment_to | 2024-05-30 | 0.50 | 0 |
| water | supplier_1 | 0_item_genesis | 2024-06-22 | 1.00 | 2 |
| water | supplier_1 | 7_shipment_from | 2024-06-22 | 1.00 | 2 |
| water | factory_1 | 2_shipment_to | 2024-06-30 | 1.00 | 2 |
| water | factory_1 | 5_BOH_usage | 2024-06-30 | 0.50 | 1 |
| level | from_location | to_location | item | ship_date | arrival_date | shipment_qty | demand_key |
|---|---|---|---|---|---|---|---|
| 1 | factory_1 | store_1 | bagel | 2024-05-25 | 2024-05-30 | 0.5 | 0 |
| 1 | supplier_1 | factory_1 | water | 2024-06-22 | 2024-06-30 | 1.0 | 2 |
Loading Supply Chain Network from Files Running obo Solver ***Starting to plan for demand key 0*** At store_1: Searching inventory for 1.0 of bagel At store_1: No inventory for bagel At store_1: Searching BodEdge bagel-factory_1 to bagel-store_1 --At factory_1: Searching inventory for 1.0 of bagel --At factory_1: No inventory for bagel --At factory_1: Searching BomOutputEdge BOM-1 to bagel-factory_1 ----At BOM 1 input 1/3: Searching for 1.0 of water ------At factory_1: Searching inventory for 1.0 of water ------At factory_1: Inventory meets all 1.0 need for water ----At BOM 1 input 1/3: Found all supply for water ----At BOM 1 input 2/3: Searching for 2.0 of flour ------At factory_1: Searching inventory for 2.0 of flour ------At factory_1: Found 1.0/2.0 inventory for flour ------At factory_1: Searching BodEdge flour-supplier_1 to flour-factory_1 --------At supplier_1: Searching inventory for 2.0 of flour --------At supplier_1: No inventory for flour --------At supplier_1: No parent edges to search. Returning found supply 0 ------At factory_1: No supply found upstream of flour-supplier_1 to flour-factory_1 ----At BOM 1 input 2/3: Found only 50.00% of need for flour ----At BOM 1 input 3/3: Searching for 0.25 of yeast ------At factory_1: Searching inventory for 0.25 of yeast ------At factory_1: Inventory meets all 0.25 need for yeast ----At BOM 1 input 3/3: Found all supply for yeast ----At BOM 1: Searching bom again for just 0.5 qty ----At BOM 1 input 1/3: Searching for 0.5 of water ------At factory_1: Searching inventory for 0.5 of water ------At factory_1: Inventory meets all 0.5 need for water ----At BOM 1 input 1/3: Found all supply for water ----At BOM 1 input 2/3: Searching for 1.0 of flour ------At factory_1: Searching inventory for 1.0 of flour ------At factory_1: Inventory meets all 1.0 need for flour ----At BOM 1 input 2/3: Found all supply for flour ----At BOM 1 input 3/3: Searching for 0.25 of yeast ------At factory_1: Searching inventory for 0.25 of yeast ------At factory_1: Inventory meets all 0.25 need for yeast ----At BOM 1 input 3/3: Found all supply for yeast --At factory_1: Found 0.5/1.0 on edge BOM-1 to bagel-factory_1 At store_1: Found 0.5/1.0 on edge bagel-factory_1 to bagel-store_1 ***Found 50.00% supply for demand key 0*** ***Starting to plan for demand key 1*** At factory_1: Searching inventory for 0.5 of water At factory_1: Inventory meets all 0.5 need for water ***Found 100.00% supply for demand key 1*** ***Starting to plan for demand key 2*** At factory_1: Searching inventory for 1.0 of water At factory_1: No inventory for water At factory_1: Searching BodEdge water-supplier_1 to water-factory_1 --At supplier_1: Genesis Node for water. All 1.0 need satisfied At factory_1: Found all supply. Done searching edges of water-factory_1 ***Found 100.00% supply for demand key 2*** Solver complete. Writing output
Created by Bill Ulrich
See the About page for more details