v.net.steiner - Creates Steiner tree for the network and given terminals. Note that 'Minimum Steiner Tree' problem is NP-hard and heuristic algorithm is used in this module so the result may be sub optimal.
vector, network, steiner tree
v.net.steiner v.net.steiner --help v.net.steiner [-g] input=name output=name [arc_type=string[,string,...]] [arc_layer=string] [node_layer=string] [acolumn=string] terminal_cats=range [npoints=integer] [--overwrite] [--help] [--verbose] [--quiet] [--ui] Flags: -g Use geodesic calculation for longitude-latitude locations --overwrite Allow output files to overwrite existing files --help Print usage summary --verbose Verbose module output --quiet Quiet module output --ui Force launching GUI dialog Parameters: input=name [required] Name of input vector map Or data source for direct OGR access output=name [required] Name for output vector map arc_type=string[,string,...] Arc type Input feature type Options: line, boundary Default: line,boundary arc_layer=string Arc layer Vector features can have category values in different layers. This number determines which layer to use. When used with direct OGR access this is the layer name. Default: 1 node_layer=string Node layer (used for terminals) Vector features can have category values in different layers. This number determines which layer to use. When used with direct OGR access this is the layer name. Default: 2 acolumn=string Arcs' cost column (for both directions) terminal_cats=range [required] Category values Categories of points on terminals (layer is specified by nlayer) npoints=integer Number of Steiner points (-1 for all possible) Default: -1
v.net.steiner calculates the optimal connection of nodes on a vector network. A Steiner tree is used to calculate the minimum-cost vector network connecting some number of end nodes in a network framework. For example it could be used to find the path following a road system which will minimize the amount of fibre optic cable needed to connect a series of satellite offices. 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 length / speed = 10 km / (100 km/h) = 0.1 h. Supported are cost assignments for both arcs and nodes. For areas, costs will be calculated along boundary lines. Points representing nodes must be exactly on network nodes, and the input vector map needs to be prepared with v.net operation=connect.
Current implementation of obtaining Steiner tree is not memory efficient. An attempt to run module on a network with large number of intersections thus might result in failure to allocate memory or out of memory condition.
Steiner tree for 6 digitized nodes (Spearfish): Shortest path, along unimproved roads: Fastest path, along highways: # Spearfish g.copy vect=roads,myroads # we have 6 locations to allocate 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, \ east double precision, north double precision, label varchar(43)" v.db.select centers v.category centers op=report # type count min max # point 6 1 6 # create lines map connecting points to network (on layer 2) v.net myroads points=centers out=myroads_net op=connect thresh=500 # set up costs as traveling time # create unique categories for each road in layer 3 v.category in=myroads_net out=myroads_net_time opt=add cat=1 layer=3 type=line # add new table for layer 3 v.db.addtable myroads_net_time layer=3 col="cat integer,label varchar(43),length double precision,speed double precision,cost double precision" # copy road type to layer 3 v.to.db myroads_net_time layer=3 qlayer=1 opt=query qcolumn=label columns=label # upload road length in miles v.to.db myroads_net_time layer=3 type=line option=length col=length unit=miles # set speed limits in miles / hour v.db.update myroads_net_time layer=3 col=speed val="5.0" v.db.update myroads_net_time layer=3 col=speed val="75.0" where="label='interstate'" v.db.update myroads_net_time layer=3 col=speed val="75.0" where="label='primary highway, hard surface'" v.db.update myroads_net_time layer=3 col=speed val="50.0" where="label='secondary highway, hard surface'" v.db.update myroads_net_time layer=3 col=speed val="25.0" where="label='light-duty road, improved surface'" v.db.update myroads_net_time layer=3 col=speed val="5.0" where="label='unimproved road'" # define traveling costs as traveling time in minutes: v.db.update myroads_net_time layer=3 col=cost val="length / speed * 60" # shortest path v.net.steiner myroads_net_time arc_layer=3 node_layer=2 terminal_cats=1-6 out=mysteiner_distance # fastest path v.net.steiner myroads_net_time arc_layer=3 node_layer=2 acol=cost terminal_cats=1-6 out=mysteiner_time 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 -c centers icon=basic/triangle d.font Vera d.vect centers col=red disp=attr attrcol=label lsize=12 d.vect mysteiner_distance col=blue width=2 # fastest path d.mon x1 d.vect myroads_net d.vect -c centers icon=basic/triangle d.font Vera d.vect centers col=red disp=attr attrcol=label lsize=12 d.vect mysteiner_time col=blue width=2
d.path, v.net, v.net.alloc, v.net.iso, v.net.path, v.net.salesman
Radim Blazek, ITC-Irst, Trento, Italy Documentation: Markus Neteler, Markus Metz Last changed: $Date: 2016-03-08 08:50:26 +0100 (Tue, 08 Mar 2016) $
Available at: v.net.steiner source code (history) Main index | Vector index | Topics index | Keywords index | Graphical index | Full index 2003-2016 GRASS Development Team, GRASS GIS 7.2.0 Reference Manual
Personal Opportunity - Free software gives you access to billions of dollars of software at no cost. Use this software for your business, personal use or to develop a profitable skill. Access to source code provides access to a level of capabilities/information that companies protect though copyrights. Open source is a core component of the Internet and it is available to you. Leverage the billions of dollars in resources and capabilities to build a career, establish a business or change the world. The potential is endless for those who understand the opportunity.
Business Opportunity - Goldman Sachs, IBM and countless large corporations are leveraging open source to reduce costs, develop products and increase their bottom lines. Learn what these companies know about open source and how open source can give you the advantage.
Free Software provides computer programs and capabilities at no cost but more importantly, it provides the freedom to run, edit, contribute to, and share the software. The importance of free software is a matter of access, not price. Software at no cost is a benefit but ownership rights to the software and source code is far more significant.
Free Office Software - The Libre Office suite provides top desktop productivity tools for free. This includes, a word processor, spreadsheet, presentation engine, drawing and flowcharting, database and math applications. Libre Office is available for Linux or Windows.
The Free Books Library is a collection of thousands of the most popular public domain books in an online readable format. The collection includes great classical literature and more recent works where the U.S. copyright has expired. These books are yours to read and use without restrictions.
Source Code - Want to change a program or know how it works? Open Source provides the source code for its programs so that anyone can use, modify or learn how to write those programs themselves. Visit the GNU source code repositories to download the source.
Study at Harvard, Stanford or MIT - Open edX provides free online courses from Harvard, MIT, Columbia, UC Berkeley and other top Universities. Hundreds of courses for almost all major subjects and course levels. Open edx also offers some paid courses and selected certifications.
Linux Manual Pages - A man or manual page is a form of software documentation found on Linux/Unix operating systems. Topics covered include computer programs (including library and system calls), formal standards and conventions, and even abstract concepts.