I hope you guys realize you might be putting yourself in danger of being accused of plagarism. Just saying.
BTW, to solve the minimum-spanning-tree (which is actually just the same as the Dijkstra algorithm) you can do:
boost::prim_minimum_spanning_tree(
g, goal_v,
get(&VertexProperty::predecessor, g),
get(&VertexProperty::distance, g),
get(&EdgeProperty::weight, g),
boost::identity_property_map(),
do_nothing_dijkstra_visitor());
which also sets the predecessors to make up the minimum-spanning-tree.
As for the traveling salesman problem, you can create a vector to hold the tour, and call the BGL function for an approximate TSP solution, as follows:
std::vector<Vertex> tsp_tour;
boost::metric_tsp_approx_tour_from_vertex(
g, start_v,
get(&EdgeProperty::weight, g),
back_inserter(tsp_tour));
And then, the vector tsp_tour
will contain the list of vertices visited by a TSP tour.