v.net.flow(1)

πŸ’– v.net.flow πŸ’–

okay bestie, so this is v.net.flow, part of the GRASS GIS User's Manual β€” it's the one that does the whole "maximum flow between two sets of nodes in a network" thing. yes. that. let's go πŸ¦‹

✨ KEYWORDS ✨

vector, network, flow


🌸 SYNOPSIS 🌸

v.net.flow
v.net.flow --help
v.net.flow input=name  [arc_layer=string]   [node_layer=string]
output=name cut=name  [arc_column=name]   [arc_backward_column=name]
[node_column=name]   [source_cats=range]   [source_where=sql_query]
[sink_cats=range]   [sink_where=sql_query]   [--overwrite]  [--help]
[--verbose]  [--quiet]  [--ui]

πŸŽ€ Flags:

  • --overwrite β€” lets your output files just. overwrite the existing ones. bold move, but ok πŸ’…
  • --help β€” prints the usage summary, aka the "what does this even do" button
  • --verbose β€” verbose module output, for when you want the module to yap
  • --quiet β€” quiet module output, for when you want it to NOT yap
  • --ui β€” forces a GUI dialog to launch. fancy ✨

πŸ“ Parameters:

  • input=name [required] β€” name of input vector map, or a data source for direct OGR access
  • arc_layer=string β€” the arc layer. so like, vector features can hold category values in different layers, and this number picks which layer gets used. when you're doing direct OGR access, this is the layer name instead. Default: 1
  • node_layer=string β€” the node layer, same whole situation as arc_layer: vector features can have category values in different layers, this number determines which layer to use, and with direct OGR access it's the layer name. Default: 2
  • output=name [required] β€” name for output vector map
  • cut=name [required] β€” name for output vector map containing a minimum cut
  • arc_column=name β€” arc forward/both direction(s) cost column (number)
  • arc_backward_column=name β€” arc backward direction cost column (number)
  • node_column=name β€” node cost column (number)
  • source_cats=range β€” source category values. Example: 1,3,7-9,13
  • source_where=sql_query β€” source WHERE conditions of an SQL statement, without the 'where' keyword. Example: income < 1000 and population >= 10000
  • sink_cats=range β€” sink category values. Example: 1,3,7-9,13
  • sink_where=sql_query β€” sink WHERE conditions of an SQL statement, without the 'where' keyword. Example: income < 1000 and population >= 10000

πŸ‘‘ DESCRIPTION πŸ‘‘

v.net.flow computes the maximum flow and minimum cut between two sets of nodes. that's it, that's the whole vibe. iconic behavior fr fr 🌈


πŸ’… NOTES πŸ’…

The two sets of nodes are called sources and sink, and v.net.flow finds the maximum flow going from the former to the latter ones. no cap.

Edge capacities can be specified by arc_column for the forward direction and arc_backward_column for the backward direction. and listen β€” if you omit that second parameter, then the same capacity gets used in either direction. the sets are given by the respective cats, layer and where parameters.

So like, maximum flow = the maximum amount of water that could possibly flow through the network while still respecting the capacity constraints. and minimum cut = the set of edges with minimum total capacity that completely separates sources from sinks. slay.

The cut produced by this module corresponds to the first fully saturated edges from sources to sinks. 🫢

An attribute table containing the flow information is linked to the output map. That table has two columns: cat and flow, and it stores the flow along each line. Negative flow means that "water" is flowing in the backward direction. (not me being dramatic about it, that's just literally what it means 😭)

Cut map contains the edges in the minimum cut.

A famous result says that the total amount of water flowing is equal to the minimum cut. ✨ periodt ✨

🌈 EXAMPLES 🌈

Find maximum flow from factories to stores using SPEED for the capacities.

v.net.flow input=roads output=roads_flow cut=roads_cut arc_column=SPEED \
           source_where="type=factory" sink_where="type=store"

If all the capacities are one, then the minimum cut corresponds to the minimum number of edges separating sources from sinks. (like, the smallest amount of stuff you can cut and still have it be a real cut πŸ’€)

v.net.flow input=network output=flow cut=cut arc_column=ones \
           source_cats=1-10 sink_cats=100-100

πŸ¦‹ SEE ALSO πŸ¦‹

  • v.net
  • v.net.connectivity

πŸŽ€ AUTHORS πŸŽ€

  • Daniel Bundala, Google Summer of Code 2009, Student
  • Wolf Bergenheim, Mentor

⭐ SOURCE CODE ⭐

Available at: v.net.flow source code (history)

Accessed: Saturday Jan 17 05:41:26 2026

Main index | Vector index | Topics index | Keywords index | Graphical index | Full index

Β© 2003-2025 GRASS Development Team, GRASS GIS 8.4.2 Reference Manual


okay that's the whole page bestie πŸ’– this was running on GRASS 8.4.2, accessed Saturday Jan 17 05:41:26 2026, and it's copyrighted by the GRASS Development Team (Β© 2003-2025) β€” go off kings πŸ‘‘ mwah, bye!! 🧚✨

πŸ“¦ where this page comes from