For performance demanding problems or simple applications, the user may call the different algorithms directly.
- distMatrix = {
- {0, 6, 5, 6, 8, 2},
- {6, 0, 4, 9, 6, 5},
- {5, 4, 0, 1, 6, 5},
- {6, 9, 1, 0, 2, 4},
- {8, 6, 6, 2, 0, 7},
- {2, 5, 5, 4, 7, 0}
- };
- {tourLength, vertexSequence} =
- TSPCycle[ FarestPointNextMethod, MatrixGraph, distMatrix, 5, 0 ]
In such cases, the parameters must be specified in the correct order. For the example in the facing column:
- calculation method
- data format
- matrix of distances between vertices
- start vertex
- protocol level
No checks are executed for consistency or plausibility.