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 accessarc_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:1node_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:2output=name[required] β name for output vector mapcut=name[required] β name for output vector map containing a minimum cutarc_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,13source_where=sql_queryβ source WHERE conditions of an SQL statement, without the 'where' keyword. Example:income < 1000 and population >= 10000sink_cats=rangeβ sink category values. Example:1,3,7-9,13sink_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.netv.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
- fedora 44: grass 8.4.2-4.fc44 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms