Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
Loading...
Searching...
No Matches
tpl_net_sup_dem_example.cc File Reference

Educational examples for supply-demand network flow problems. More...

#include <iostream>
#include <tpl_net_sup_dem.H>
#include <tpl_net.H>
Include dependency graph for tpl_net_sup_dem_example.cc:

Go to the source code of this file.

Functions

int main ()
 

Detailed Description

Educational examples for supply-demand network flow problems.

WHAT IS SUPPLY-DEMAND FLOW?

Network flow where:

  • SUPPLY nodes: Produce goods (positive supply value)
  • DEMAND nodes: Consume goods (negative supply value)
  • TRANSIT nodes: Neither produce nor consume (zero supply)

GOAL: Route flow from suppliers to consumers respecting capacity constraints

KEY CONCEPTS:

  • Conservation: Flow in = Flow out (except at sources/sinks)
  • Capacity: Arc flow ≤ arc capacity
  • Balance: Total supply = Total demand (for feasibility)

REAL-WORLD APPLICATIONS:

  • Supply chain logistics
  • Power grid distribution
  • Water distribution networks
  • Transportation planning

COMPILE & RUN:

g++ -std=c++20 -I.. -o tpl_net_sup_dem_example tpl_net_sup_dem_example.cc ./tpl_net_sup_dem_example

Definition in file tpl_net_sup_dem_example.cc.

Function Documentation

◆ main()

int main ( )

Definition at line 40 of file tpl_net_sup_dem_example.cc.

References Aleph::maps().