weighted graphs table of the graph to prove that the graph is constructed properly you'll need to store the weight of each edge somewhere one approach is to use an edge classwhich stores its weight and the vertex on which it ends each vertex then keeps list of edge objects--that isedges that start on that vertex implement floyd' algorithm you can start with the path java program (listing and modify it as appropriate for instanceyou can delete all the shortestpath code keep the infinity representation for unreachable vertices by doing thisyou will avoid the need to check for when comparing an existing cost with newly derived cost the costs on all possible routes will be less than infinity you should be able to enter graphs of arbitrary complexity into main( implement the traveling salesman problem described in the "intractable problemssection in this in spite of its intractabilityit will have no trouble solving the problem for small nsay cities or fewer try nondirected graph use the brute-force approach of testing every possible sequence of cities for way to permute the sequence of citiessee the anagram java program (listing in "recursion use infinity to represent nonexistent edges that wayyou won' need to abort the calculation of sequence when it turns out that an edge from one city to the next does not existany total greater than infinity is an impossible route alsodon' worry about eliminating symmetrical routes display both abcdea and aedcbafor example write program that discovers and displays all the hamiltonian cycles of weightednon-directed graph