Learn R Programming

tspmeta (version 1.2)

morph_instances: Morphing (convex-combination) of two instances with parameter alpha.

Description

Pairs of cities are matched in a greedy fashion, see greedy_point_matching.

Usage

morph_instances(x, y, alpha)

Arguments

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

Value

[tsp_instance] Morphed TSP instance.

Examples

Run this code
x = random_instance(10)
y = random_instance(10)
z = morph_instances(x, y, 0.5)
autoplot(x)
autoplot(y)
autoplot(z)

Run the code above in your browser using DataLab