link.tsp Function (GPL)

Syntax

link.tsp(<algebra>)

or

link.tsp(<binning function>)

or

link.tsp(<statistic function>)

<algebra>. Graph algebra, such as x*y. Refer to Brief Overview of GPL Algebra for an introduction to graph algebra.

<binning function>. A binning function.

<statistic function>. Another statistic function. The result of the embedded statistic is used to calculate link.tsp.

Description

Calculates the solution to the travelling salesman problem (TSP) for the values. This function is typically used with the edge or path graphic element. The solution to the TSP is the shortest path that traverses all values once and starts and ends at the same value.

Examples

Figure 1. Example: Drawing the solution to the travelling salesman problem
ELEMENT: edge(position(link.tsp(x*y)))

Statistic Functions

See GPL Functions .