a connected (di)graph
(optional) a Matrix containing edge weights
The TravelingSalesman command returns two objects, w of type numeric and the second C a list which is a permutation of the vertices The first output is the optimal value for the traveling salesman problem, and the second is a Hamiltonian cycle that achieves the optimal value.
The algorithm is a branch-and-bound algorithm using the Reduce bound (see Kreher and Stinson, 1999).
If a second argument is specified, it is used for the weights. If an edge from vertex u to v is not in G then, regardless of the edge weight in M, it is treated as infinity.
If G is not a weighted graph then the adjacency matrix of G is used for the edge weights.
G≔Graph 1: an undirected weighted graph with 4 vertices and 4 edge(s)
Graph 1: an undirected weighted graph with 4 vertices and 6 edge(s)
Download Help Document
What kind of issue would you like to report? (Optional)