← All work

Water distribution networks / Data & IoT

Understanding a water network, one connection at a time.

A Python project that models water-distribution networks and compares their structure before and after proposed expansion.

My role
Python / graph algorithms
When
2025
Built with
Python · Matplotlib · Dijkstra · Maximum flow · Graph algorithms
Network analysis plot of water distribution sectors
Water distribution networks · original analysis output · Open full size ↗

Explore how it works

Try it yourself ↓
Interactive explanation · illustrative sample

One new pipe can change the whole network.

Adjust an inlet, add a direct connection, and compare capacity with the shortest route.

Six nodes. One connected system.8 pipes
6/6S to A: 6 of 6 L/s, 3 km, pipe 13/4S to B: 3 of 4 L/s, 2 km, pipe 24/4A to C: 4 of 4 L/s, 2 km, pipe 32/2A to D: 2 of 2 L/s, 4 km, pipe 41/2B to C: 1 of 2 L/s, 2 km, pipe 52/3B to D: 2 of 3 L/s, 3 km, pipe 65/5C to T: 5 of 5 L/s, 3 km, pipe 74/4D to T: 4 of 4 L/s, 2 km, pipe 8SSourceAJunctionBJunctionCJunctionDJunctionTOutlet

Each label shows flow / capacity in L/s. Pipes are directed from left to right.

Inspect all pipe values
Current flow, capacity, and distance for each directed pipe.
PipeFlow
(L/s)
Capacity
(L/s)
Distance
(km)
S → A663
S → B342
A → C442
A → D224
B → C122
B → D233
C → T553
D → T442
Change the network
6 L/s

The direct pipe adds 3 L/s of capacity across a 2 km connection.

Maximum flow9 L/s
Shortest route7 km
The outlet branches cap the flow.

Increasing one inlet alone cannot push more than 9 L/s through the two outlet branches.

A fictional directed network runs Dijkstra and Edmonds–Karp in your browser. Capacities and distances are illustrative; this does not simulate hydraulic pressure or a real water system.

The challenge

A water network is a system of connected sources, pipes, and destinations. This academic project explores how that structure affects sectoring, capacity, sampling routes, and the consequences of adding new connections.

How I built it

Turn the network into a graph

I parsed four network instances into nodes, pipes, sources, and proposed connections, then partitioned networks by source and analyzed shortest paths and maximum flow.

Plan a sampling route

Dijkstra distances provided the basis for water-sampling tours. Nearest-neighbor ordering produced an initial route, followed by 2-opt improvements.

Make the comparison visible

Generated reports and Matplotlib plots show the network before and after expansion, alongside sector boundaries and connection capacities.

What came out of it

An academic network-analysis program with source code, reports, and actual generated visualizations. The project demonstrates graph-based planning on simulated network instances.

Original plots from the project repository: the HAN network before expansion, after expansion, and divided into sectors.

Sources & project context

More from the project

Water distribution networks project screenshot 1
Water distribution networks · project capture 1
Water distribution networks project screenshot 2
Water distribution networks · project capture 2
Next projectCapitalU ↗