R/morphInstances.R
morphInstances.Rd
This function takes two (clustered) networks with equal number of nodes and, if present, equal number of depots, and generates another instance by applying a convex combination to the coordinates of node pairs. The node pairs are determined by a point matching algorithm, which solves this assignement problem via a integer programming procedure. If both instances contain depots, point matching is done separately on depots and the remaining nodes.
morphInstances(x, y, alpha, point.matching = NULL, point.matching.algorithm = getOptimalPointMatching)
x | [ |
---|---|
y | [ |
alpha | [ |
point.matching | [ |
point.matching.algorithm | [ |
[Network
]
Morphed network
x = generateRandomNetwork(n.points = 40L, n.depots = 2L) y = generateClusteredNetwork(n.points = 40L, n.cluster = 2L, n.depots = 2L) z = morphInstances(x, y, alpha = 0.2) #> Loading required package: lpSolve if (FALSE) { library(gridExtra) plot.list = list(autoplot(x), autoplot(z), autoplot(y)) plot.list$nrow = 1 do.call(grid.arrange, plot.list) }