morphInstances: Morphing of two networks with a convex combination of the...

Description Usage Arguments Value See Also Examples

View source: R/morphInstances.R

Description

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.

Usage

1
2
morphInstances(x, y, alpha, point.matching = NULL,
  point.matching.algorithm = "push_relabel")

Arguments

x

[Network]
First network.

y

[Network]
Second network.

alpha

[numeric(1)]
Coeffiecient alpha for convex combination.

point.matching

[matrix | NULL]
Point matching which shall be used for morphing. If NULL, an optimal point matching is generated via function getOptimalPointMatching. Default is NULL. Currently it is just possible to pass a point matching for instances without depots.

point.matching.algorithm

[function]
Algorithm used to find a point matching. . See argument method of getOptimalPointMatching.

Value

[Network] Morphed network.

See Also

visualizeMorphing, visualizePointMatching

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
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, point.matching.algorithm = "push_relabel")
## Not run: 
library(gridExtra)
plot.list = list(autoplot(x), autoplot(z), autoplot(y))
plot.list$nrow = 1
do.call(grid.arrange, plot.list)

## End(Not run)

netgen documentation built on Jan. 9, 2020, 1:07 a.m.