plot_tour {gor}R Documentation

TSP tour simple plotting

Description

Plotting tours constructed by tour-building routines for TSP

Usage

plot_tour(z, h, ...)

Arguments

z

Set of points of a TSP

h

List with $tour and $distance components returned from a TSP tour building algorithm

...

Parameters to be passed to plot

Details

It plots the two-dimensional cities of a TSP and a tour among them for visualization purposes. No aesthetically appealing effort has been invested in this function.

Value

This function is called by its side effect.

Author(s)

Cesar Asensio

See Also

build_tour_nn nearest neighbor heuristic with a single starting point, build_tour_nn_best repeats the previous algorithm with all possible starting points, compute_distance_matrix computes the distance matrix of a set of two-dimensional points.

Examples

set.seed(1)
n <- 25
z <- cbind(runif(n,min=1,max=10),runif(n,min=1,max=10))
d <- compute_distance_matrix(z)
b <- build_tour_nn_best(d, n)
plot_tour(z,b)


[Package gor version 1.0 Index]