LinKernighanTSP

final case class LinKernighanTSP(init: I, weights: D, size: I, mode: I, timeOut: D) extends MultiOut[Any]

A UGen that solves the traveling salesman problem (TSP) using the Lin-Kernighan heuristic. For each input value of size, a corresponding initial tour and edge weight sequence are read, the tour is optimized and output along with the tour's cost.

Currently, we output two channels:

  • 0 - tour - the optimized tour
  • 1 - cost - the cost of the optimized tour, i.e. the sum of its edge weights
Value parameters:
init

the initial tour, for example linear or randomized. Should consist of size zero-based vertex indices

mode

currently unused and should remain at the default value of zero.

size

for each complete graph, the number of vertices.

timeOut

currently unused and should remain at the default value of zero.

weights

the symmetric edge weights, a sequence of length size * (size - 1) / 2, sorted as vertex connections (0,1), (0,2), (0,3), ... (0,size-1), (1,2), (1,3), ... (1,size-1), etc., until (size-2,size-1).

Companion:
object
trait Serializable
trait MultiOut[Any]
trait Lazy[Any]
trait GE[Any]
trait UGenSource[UGenInLike[Any], IndexedSeq[StreamOut]]
trait Expander[UGenInLike[Any]]
trait Lazy
trait Product
trait Equals
class Object
trait Matchable
class Any

Value members

Concrete methods

def cost: D
def tour: I

Inherited methods

final def name: String
Inherited from:
UGenSource
def productElementNames: Iterator[String]
Inherited from:
Product
def productIterator: Iterator[Any]
Inherited from:
Product