A comprehensive benchmarking suite for maximum flow algorithms with specialized datasets and real-world case studies.
Each algorithm folder contains implementations and scripts to run all 21 datasets:
# Edmonds-Karp Algorithm
cd edmonds_karp
./run_all_datasets.sh # Runs edmonds_karp.py on all datasets
python3 edmonds_karp.py ../datasets/DATASET_NAME.txt # Single dataset
# Dinic's Algorithm
cd dinic
./run_all_datasets.sh # Runs dinic.py on all datasets
python3 dinic.py ../datasets/DATASET_NAME.txt # Single dataset
# Push-Relabel Algorithm (includes Gap Heuristic)
cd push_relabel
./run_all_datasets.sh # Runs both standard and gap-optimized versions
python3 push_relabel.py ../datasets/DATASET_NAME.txt # Single datasetOutput Files:
output.txt- Detailed execution log with flow values and pathsmetrics.txt- Performance summary table with runtime and memory usage
Each case study demonstrates real-world applications:
# Airline Crew Scheduling (Hopcroft-Karp for bipartite matching)
cd case_studies/airline_scheduling
python3 Hopcroft-Karp_Implementation/hopcroft_karp_scheduler.py
# Image Segmentation (Boykov-Kolmogorov for grid graphs)
cd case_studies/image_segmentation
python3 Boykov-Kolmogorov_Implementation/boykov_kolmogorov_segmentation.py
# Video Segmentation (Temporal extension)
cd case_studies/video_segmentation
python3 video_segmentation.py
# Network Routing (Bandwidth optimization)
cd case_studies/network_routing
python3 Edmonds-Karp_Implementation/edmonds_karp_router.pyTo regenerate the 21 specialized benchmark datasets:
cd datasets
python3 generate_test_graphs.pyThis creates 7 categories of graphs (Dense, Sparse, Bipartite, Grid, LongPath, MultiStage, RandomDAG) with 3 datasets each.
To run all algorithms on all datasets and generate comparison results:
python3 run_full_benchmark.pyThis executes all algorithms, collects metrics, and generates benchmark_results.csv.
To view interactive performance visualizations:
python3 dashboard.pyOpens a web-based dashboard with:
- Runtime comparison charts
- Memory usage analysis
- Algorithm performance by dataset category
- Case study results
Python implementations with comprehensive metrics collection:
- Edmonds-Karp
- Dinic's Algorithm
- Push-Relabel (FIFO)
BIPARTITE_250x1000.txtBIPARTITE_500x2000.txtBIPARTITE_1000x4000.txtDENSE_0050.txtDENSE_0100.txtDENSE_0200.txtGRID_20x20.txtGRID_30x30.txtGRID_40x40.txtLONGPATH_0100.txtLONGPATH_0200.txtLONGPATH_0500.txtMULTISTAGE_5x20.txtMULTISTAGE_7x15.txtMULTISTAGE_10x10.txtRANDOM_DAG_0100.txtRANDOM_DAG_0300.txtRANDOM_DAG_0500.txtSPARSE_0500.txtSPARSE_1000.txtSPARSE_2000.txt
| Dataset | Edmonds-Karp | Dinic | Push-Relabel |
|---|---|---|---|
| BIPARTITE_250x1000 | ✓ | Best | ✓ |
| BIPARTITE_500x2000 | ✓ | Best | ✓ |
| BIPARTITE_1000x4000 | ✓ | Best | ✓ |
| DENSE_0050 | ✓ | ✓ | Best |
| DENSE_0100 | ✓ | ✓ | Best |
| DENSE_0200 | ✓ | ✓ | Best |
| GRID_20x20 | ✓ | ✓ | Best |
| GRID_30x30 | ✓ | ✓ | Best |
| GRID_40x40 | ✓ | ✓ | Best |
| LONGPATH_0100 | Slow | Best | ✓ |
| LONGPATH_0200 | Slow | Best | ✓ |
| LONGPATH_0500 | Slow | Best | ✓ |
| MULTISTAGE_5x20 | ✓ | Best | ✓ |
| MULTISTAGE_7x15 | ✓ | Best | ✓ |
| MULTISTAGE_10x10 | ✓ | Best | ✓ |
| RANDOM_DAG_0100 | ✓ | Best | ✓ |
| RANDOM_DAG_0300 | ✓ | Best | ✓ |
| RANDOM_DAG_0500 | ✓ | Best | ✓ |
| SPARSE_0500 | ✓ | Best | ✓ |
| SPARSE_1000 | ✓ | Best | ✓ |
| SPARSE_2000 | ✓ | Best | ✓ |
Real-world applications using max flow algorithms:
- Airline Scheduling (pilot-flight matching)
- Image Segmentation (foreground/background separation)
- Network Routing (bandwidth optimization)
| Case Study | Edmonds-Karp | Dinic | Push-Relabel |
|---|---|---|---|
| Airline Scheduling | Used | ✓ | ✓ |
| Image Segmentation | Used | ✓ | ✓ |
| Network Routing | Used | ✓ | ✓ |