Objective
When a vendor like Acme Steel halts shipments, ops teams need to know — within minutes — every downstream product, finished good, and customer at risk. Modeling the supply chain as a graph turns this from an operations nightmare into a single MATCH that walks the full dependency tree.
Step 1: Create the graph
// Vendors (raw material suppliers)
MERGE (acme:Vendor {name: "Acme Steel", country: "US"})
MERGE (helio:Vendor {name: "Helios Plastics", country: "MX"})
MERGE (lumen:Vendor {name: "Lumen Electronics", country: "TW"})
// Materials supplied
MERGE (steel:Material {name: "Cold-Rolled Steel"})
MERGE (alum:Material {name: "Aluminum Sheet"})
MERGE (poly:Material {name: "ABS Polymer"})
MERGE (chip:Material {name: "Microcontroller"})
MERGE (acme)-[:SUPPLIES]->(steel)
MERGE (acme)-[:SUPPLIES]->(alum)
MERGE (helio)-[:SUPPLIES]->(poly)
MERGE (lumen)-[:SUPPLIES]->(chip)
// Components made from materials
MERGE (frame:Component {name: "Chassis Frame"})
MERGE (housing:Component {name: "Outer Housing"})
MERGE (board:Component {name: "Control Board"})
MERGE (panel:Component {name: "Display Panel"})
MERGE (frame)-[:USES]->(steel)
MERGE (frame)-[:USES]->(alum)
MERGE (housing)-[:USES]->(poly)
MERGE (board)-[:USES]->(chip)
MERGE (panel)-[:USES]->(chip)
MERGE (panel)-[:USES]->(poly)
// Finished products
MERGE (washer:Product {sku: "WSH-200", name: "EcoWash Washer"})
MERGE (fridge:Product {sku: "FRG-300", name: "ColdSaver Fridge"})
MERGE (oven:Product {sku: "OVN-100", name: "BreezeBake Oven"})
MERGE (washer)-[:CONTAINS]->(frame)
MERGE (washer)-[:CONTAINS]->(board)
MERGE (fridge)-[:CONTAINS]->(frame)
MERGE (fridge)-[:CONTAINS]->(panel)
MERGE (oven)-[:CONTAINS]->(housing)
MERGE (oven)-[:CONTAINS]->(board)
// Customers and orders
MERGE (c1:Customer {name: "BigBox Retail"})
MERGE (c2:Customer {name: "HomeStyle Co"})
MERGE (c3:Customer {name: "MetroAppliance"})
MERGE (c1)-[:ORDERED {qty: 2400}]->(washer)
MERGE (c1)-[:ORDERED {qty: 1800}]->(fridge)
MERGE (c2)-[:ORDERED {qty: 950}]->(oven)
MERGE (c3)-[:ORDERED {qty: 600}]->(fridge);