v.net.flow(1grass)
π§ v.net.flow β the glow-up edition
okay bestie, gather round, because today we're talking about v.net.flow, a GRASS module (yes, from the GRASS User's Manual, and yes it's giving main character energy) that computes the maximum flow between two sets of nodes in the network. that's it, that's the whole vibe. π
KEYWORDS: vector, network, flow
β¨ SYNOPSIS β¨
no cap, here's the exact invocation situation:
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β let your output files just, like, bulldoze whatever was already there. Allow output files to overwrite existing files π--helpβ print the usage summary, aka the "bestie explain" button--verboseβ verbose module output, we're being chatty today π--quietβ quiet module output, shhh, no thoughts head empty--uiβ force launching the GUI dialog, for when you want the pretty buttons π¦
πΈ Parameters
input=name[required] β name of the input vector map. Or, if you're feeling adventurous, a data source for direct OGR access.arc_layer=stringβ the arc layer. lowkey important: vector features can have category values in different layers, and this number decides which layer we're using. when you're doing direct OGR access this is the layer name instead. default:1node_layer=stringβ the node layer. same whole situation as above (different layers, pick the number; OGR access means it's the layer name). default:2output=name[required] β the name for the output vector map π«Άcut=name[required] β the name for the output vector map that holds 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 thewherekeyword. 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 thewherekeyword. example:income < 1000 and population >= 10000
π DESCRIPTION π
v.net.flow computes the maximum flow and minimum cut between two sets of nodes. iconic behaviour honestly. β¨
π NOTES π
so the two sets of nodes are called sources and sink, and v.net.flow finds the maximum flow from the former to the latter ones. bestie, it's giving plumbing.
edge capacities can be set with arc_column for the forward direction and arc_backward_column for the backward direction. and here's the tea: if you omit that second parameter, the same capacity gets used in either direction. the sets are given by the respective cats, layer and where parameters. π
maximum flow = the maximum amount of water that could possibly flow through the network while preserving the capacity constraints. minimum cut = the set of edges of minimum total capacity that completely separates sources from sinks. the cut this module produces corresponds to the first fully saturated edges from sources to sinks.
an attribute table containing the flow information is linked to the output map. this table has two columns: cat and flow, and it stores the flow along each line. and yes β negative flow means that "water" is flowing in the backward direction π weird but true. the 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 the 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"
and if all the capacities are one, then the minimum cut corresponds to the minimum number of edges separating sources from sinks. so slay:
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)
latest change: Friday May 09 14:33:40 2025 in commit: b356c7e108fcbeca77474c8e83ebec8f1e7b3e4a
main index | vector index | topics index | keywords index | graphical index | full index
okay that's the whole page bestie, go compute some flows and be the main character of your network analysis π
Β© 2003-2026 GRASS Development Team, GRASS 8.5.0 Reference Manual β mwah, that's the GRASS 8.5.0 reference manual era, dated and everything πΈπ§β¨
π¦ where this page comes from
- alpine 3.24: grass-gis-doc 8.5.0-r1 Β· GPL-2.0-or-later
- ubuntu stonking: grass-doc 8.5.0-1ubuntu1 Β· 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