๐ Warehouse-to-Store Spare Parts Distribution System
This project simulates a supply chain management system for distributing spare parts from multiple warehouses to stores. It uses graph algorithms to ensure efficient logistics, minimize costs, and manage inventory dynamically.
๐ง Key Features
- ๐บ๏ธ Shortest Path Calculation using Dijkstraโs Algorithm for optimal delivery routing.
- ๐ Minimum Spanning Tree (MST) using Kruskalโs Algorithm to minimize total infrastructure cost.
- ๐ฆ Dynamic Inventory Management for warehouses (stock levels, prices).
- ๐ช Store Order Processing with real-time decision-making.
- ๐งช Random Order Simulation for testing load and efficiency.
- ๐ Order Statistics tracking total orders and cost savings.
๐ ๏ธ Components
โ SparePart Class
Represents an individual part with a name, quantity, and price.
๐ฌ Warehouse Class
- Holds an inventory of spare parts.
- Supports stock addition and real-time availability checking.
๐ช Store Class
- Basic store representation (ID + Name).
- Used to simulate order placement.
๐ Graph Class
- Models the network of stores and warehouses.
- Dijkstraโs algorithm helps determine the shortest delivery paths.
๐งฎ OrderProcessor
- Matches store orders with nearest warehouses having enough stock.
- Prioritizes by price and distance.
- Calculates total order cost and logs metrics.
๐๏ธ SupplyChainSystem
- Integrates all components.
- Loads data from files (
warehouses.txt, stores.txt, connections.txt).
- Provides CLI for interaction (e.g., add warehouse/store, process orders, MST view, simulate orders).
๐งช Example Usage
```bash
$ ./supply_chain_app
=== Spare Parts Distribution System ===
- Describe System
- Show Warehouses
- Show Stores
- Process Order
- Minimum Spanning Tree
- Simulate Random Orders
- Show Statistics
- Add Warehouse
- Add Store
- Add Stock to Warehouse
- Exit