creates an approximated Steiner tree for a flow map visualization
tnss_tree(
g,
xy,
xydummy,
root,
gamma = 0.9,
epsilon = 0.3,
elen = Inf,
order = "random"
)
original flow network (must be a one-to-many flow network, i.e star graph). Must have a weight attribute indicating the flow
coordinates of "real" nodes
coordinates of "dummy" nodes
root node id of the flow
edge length decay parameter
percentage of points keept on a line after straightening with Visvalingam Algorithm
maximal length of edges in triangulation
in which order shortest paths are calculated ("random","weight","near","far")
approximated Steiner tree from dummy and real nodes as igraph object
Use tnss_smooth to smooth the edges of the tree
Sun, Shipeng. "An automated spatial flow layout algorithm using triangulation, approximate Steiner tree, and path smoothing." AutoCarto, 2016.
xy <- cbind(state.center$x,state.center$y)[!state.name%in%c("Alaska","Hawaii"),]
xy_dummy <- tnss_dummies(xy,root = 4)
gtree <- tnss_tree(cali2010,xy,xy_dummy,root = 4,gamma = 0.9)