Skip to content

πŸ›°οΈ An interactive visual simulator that models internet packet flow across a custom network using max-flow algorithms. It helps analyze routing efficiency using Dinic, Edmonds-Karp, Goldberg-Tarjan , Boykov-Kolmogorov and MCMF algorithms in real-time.

License

Notifications You must be signed in to change notification settings

AtharvaKulkarniIT/internet-packet-flow-simulator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

9 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ“¦ Internet Packet Flow Simulator

Visualize and simulate internet packet routing using graph-based Max-Flow algorithms. Built using React + React Flow for frontend and C++ for high-performance backend algorithms served via Flask server.py


πŸ”§ Setup Instructions

1. Clone the Repository

git clone https://github.com/AtharvaKulkarniIT/internet-packet-flow-simulator.git
cd internet-packet-flow-simulator

2. Compile C++ Algorithms

Make sure you have g++ installed.

g++ backend/dinic.cpp -o bin/dinic
g++ backend/edmonds_karp.cpp -o bin/edmonds_karp
g++ backend/goldberg_tarjan.cpp -o bin/goldberg_tarjan
g++ backend/mcmf.cpp -o bin/mcmf
g++ backend/boykov_kolmogorov.cpp -o bin/boykov_kolmogorov

3. Install React Frontend

cd frontend
npm install

4. Start the Flask Server

Make sure Python and Flask are installed.

cd server
python server.py

5. Start the Frontend

In another terminal:

cd frontend
npm run dev

πŸ–₯️ Recommended Split Terminal Setup

Split your terminal into 3 panes:

# Pane 1 - Flask Server
cd server
python server.py

# Pane 2 - Compile C++ once
cd backend
g++ dinic.cpp -o ../bin/dinic && g++ edmonds_karp.cpp -o ../bin/edmonds_karp
g++ goldberg_tarjan.cpp -o ../bin/goldberg_tarjan && g++ mcmf.cpp -o ../bin/mcmf
g++ boykov_kolmogorov.cpp -o ../bin/boykov_kolmogorov

# Pane 3 - React App
cd frontend
npm run dev

πŸš€ Project Overview

  • Interactive UI to add/delete routers (nodes) and connections (edges)
  • Select source/destination nodes
  • Run simulations using Dinic’s, Edmonds-Karp, Goldberg-Tarjan, MCMF, or Boykov-Kolmogorov
  • Visual flow animation on the React Flow canvas
  • Backed by high-performance C++ for real-time simulation

βš™οΈ Algorithms

Algorithm Description Time Complexity Space Complexity
Dinic’s Uses BFS + layered DFS to send flow O(V^2 * E) O(V + E)
Edmonds-Karp BFS-based Ford-Fulkerson O(V * E^2) O(V + E)
Goldberg-Tarjan Push-relabel with height + excess flow O(V^2 * sqrt(E)) O(V^2)
MCMF Min-cost max-flow using SPFA/Dijkstra O(F * E * logV) O(V + E)
Boykov-Kolmogorov Augmenting paths via search trees (good for vision) O(n^2) (practical fast) O(V + E)

πŸ“ Project Structure

internet-packet-simulator/
β”œβ”€β”€ backend/
β”‚   β”œβ”€β”€ dinic.cpp
β”‚   β”œβ”€β”€ edmonds_karp.cpp
β”‚   β”œβ”€β”€ goldberg_tarjan.cpp
β”‚   β”œβ”€β”€ mcmf.cpp
β”‚   β”œβ”€β”€ boykov_kolmogorov.cpp
β”‚   β”œβ”€β”€ *.h
β”œβ”€β”€ bin/                 # Compiled binaries
β”‚   β”œβ”€β”€ dinic
β”‚   β”œβ”€β”€ edmonds_karp
β”‚   β”œβ”€β”€ goldberg_tarjan
β”‚   β”œβ”€β”€ mcmf
β”‚   └── boykov_kolmogorov
β”œβ”€β”€ server/
β”‚   └── server.py
β”œβ”€β”€ frontend/
β”‚   β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ public/
β”‚   β”œβ”€β”€ index.html
β”‚   └── vite.config.js

Goldberg-Tarjan


πŸ“„ License

This project is licensed under the MIT License β€” use freely, modify and distribute with attribution.

About

πŸ›°οΈ An interactive visual simulator that models internet packet flow across a custom network using max-flow algorithms. It helps analyze routing efficiency using Dinic, Edmonds-Karp, Goldberg-Tarjan , Boykov-Kolmogorov and MCMF algorithms in real-time.

Topics

Resources

License

Stars

Watchers

Forks