Maple Professional
Maple Academic
Maple Student Edition
Maple Personal Edition
Maple Player
Maple Player for iPad
MapleSim Professional
MapleSim Academic
Maple T.A. - Testing & Assessment
Maple T.A. MAA Placement Test Suite
Möbius - Online Courseware
Machine Design / Industrial Automation
Aerospace
Vehicle Engineering
Robotics
Power Industries
System Simulation and Analysis
Model development for HIL
Plant Modeling for Control Design
Robotics/Motion Control/Mechatronics
Other Application Areas
Mathematics Education
Engineering Education
High Schools & Two-Year Colleges
Testing & Assessment
Students
Financial Modeling
Operations Research
High Performance Computing
Physics
Live Webinars
Recorded Webinars
Upcoming Events
MaplePrimes
Maplesoft Blog
Maplesoft Membership
Maple Ambassador Program
MapleCloud
Technical Whitepapers
E-Mail Newsletters
Maple Books
Math Matters
Application Center
MapleSim Model Gallery
User Case Studies
Exploring Engineering Fundamentals
Teaching Concepts with Maple
Maplesoft Welcome Center
Teacher Resource Center
Student Help Center
GraphTheory[TravelingSalesman]
Calling Sequence
TravelingSalesman(G)
TravelingSalesman(G, M)
Parameters
G
-
a connected (di)graph
M
a Matrix containing edge weights (optional)
Description
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.
Examples
See Also
AllPairsDistance, IsHamiltonian, WeightMatrix
Download Help Document