|
NAMEv.net.salesman - Creates a cycle connecting given
nodes (Traveling salesman problem).
KEYWORDSvector, network, salesman SYNOPSISv.net.salesman
Flags:Parameters:
DESCRIPTIONv.net.salesman calculates the optimal route to visit nodes on a vector network. Costs may be either line lengths, or attributes saved in a
database table. These attribute values are taken as costs of whole segments,
not as costs to traverse a length unit (e.g. meter) of the segment. For
example, if the speed limit is 100 km / h, the cost to traverse a 10 km long
road segment must be calculated as
The input vector needs to be prepared with v.net operation=connect in order to connect points representing center nodes to the network. Points specified by category must be exactly on network nodes, and the input vector map needs to be prepared with v.net operation=connect. Application of flag -t enables a turntable support. This flag requires additional parameters turn_layer and turn_cat_layer that are otherwise ignored. The turntable allows to model e.g. traffic code, where some turns may be prohibited. This means that the input layer is expanded by turntable with costs of every possible turn on any possible node (intersection) in both directions. Turntable can be created by the v.net module. For more information about turns in the vector network analyses see wiki page. NOTESArcs can be closed using cost = -1. Turns support: The costs of turns on visiting nodes are not taken in account. EXAMPLETraveling salesman for 6 digitized nodes (Spearfish): Shortest path, along unimproved roads: Fastest path, along highways: Searching for the shortest path using distance and the fastest
path using traveling time according to the speed limits of different road
types:
# Spearfish g.copy vect=roads,myroads # we have 6 locations to visit on our trip echo "1|601653.5|4922869.2|a 2|608284|4923776.6|b 3|601845|4914981.9|c 4|596270|4917456.3|d 5|593330.8|4924096.6|e 6|598005.5|4921439.2|f" | v.in.ascii in=- cat=1 x=2 y=3 out=centers col="cat integer, \To display the result, run for example: # Display the results g.region vector=myroads_net # shortest path d.mon x0 d.vect myroads_net d.vect centers -c icon=basic/triangle d.vect mysalesman_distance col=green width=2 d.font Vera d.vect centers col=red disp=attr attrcol=label lsize=12 # fastest path d.mon x1 d.vect myroads_net d.vect centers -c icon=basic/triangle d.vect mysalesman_time col=green width=2 d.font Vera d.vect centers col=red disp=attr attrcol=label lsize=12 SEE ALSOd.path, v.net, v.net.alloc, v.net.iso, v.net.path, v.net.steiner AUTHORSRadim Blazek, ITC-Irst, Trento, Italy
TURNS SUPPORTThe turns support was implemnented as part of GRASS GIS turns cost
project at Czech Technical University in Prague, Czech Republic.
Implementation: Stepan Turek
SOURCE CODEAvailable at: v.net.salesman source code (history) Latest change: Sunday Apr 28 22:56:11 2024 in commit: b2992f7396c8b8bf8f2d041318b1248c234c5ab3 Main index | Vector index | Topics index | Keywords index | Graphical index | Full index © 2003-2025 GRASS Development Team, GRASS GIS 8.4.1 Reference Manual
|