In the case of the TSP, finding the optimal solution for a large number of nodes can end up taking too much time to compute, meaning that we have nothing to compare our heuristic solutions to.
This is where the **Minimum Spanning Tree (MST)** comes in.
-_The minimum spanning tree is the set of edges that connects all the nodes with the minimum cost (in the case of the TSP, the costs is the distance between nodes) and no cycles._
+_The minimum spanning tree is the set of edges that connects all the nodes with the minimum cost (in the case of the TSP, the costs is the distance between nodes) and no cycles._ A different way of thinking about it would be to find all the shortest distances between nodes and add that edge into the MST until we have connected all the nodes.
+
**For example:** A graph with 4 nodes: A,B,C,D at (0,0), (0,10), (20,0), (20,10) respectively on the Cartesian Plane will have a MST of 40.0.
This is because the MST only needs to connect all the nodes in the shortest distance possible, which in this case would be the edges AB + BC + CD. There is also another MST that is equally good which is simply AB + AD + CD.

-The usefulness of the MST lies in the fact that the optimal tour which in the case of the example above is highlighted in green, is always greater than the MST.
-`MST Cost < Optimal Tour Cost` Since we are not trying to find the optimal solution, but a solution that is good enough and that we can calculate within a reasonable amount of time (heuristic solution) we can compare our solution to the minimum spanning tree and get an approximation ratio.
+The usefulness of the MST lies in the fact that the optimal tour which in the case of the example above is highlighted in green, is always greater than the MST. This is true because if you were to take the optimal solution and remove any of the edges (to create no cycles), you would be left with a spanning tree which would be greater than or equal to the minimum spanning tree.
+Therefore, the `MST Cost < Optimal Tour Cost` Since we are not trying to find the optimal solution, but a solution that is good enough and that we can calculate within a reasonable amount of time (heuristic solution) we can compare our solution to the minimum spanning tree and get an approximation ratio.
Take this graph for instance. The grey circles represent nodes or towns in the TSP, the blue line represents the Nearest Neighbor heuristic solution and the red line represents the MST.

By manipulating the result, we can determine how much our solution overshot the lower bound.
Of course this value does not represent to a high degree of accuracy how much we overshot the optimal solution, but it does give us ballpark numbers.
In this case, the approximation ratio is `46.6%` of the MST.
-(As an exercise to the reader, can you determine why this is the MST?)
+(As an exercise to the reader, can you determine to why the Minimum Spanning Tree shown in the graph above is correct?)
+
+**The One Tree**
+
+The One Tree is an even better lower bound which will be greater than the MST, but still less than the optimal tour.
+`MST Cost < One Tree Lower Bound Cost < Optimal Tour Cost` This lower bound will be more useful than the MST because it will give us more precise approximation ratios as the One Tree lower bound will be closer to the optimal solution.
+But, how do we determine the One Tree Lower Bound?
+1. If we remove any vertex from the graph and find the MST of the remaining nodes
+2. Then connect the two shortest edges to the removed vertex back into the tree
+
+This one tree is guaranteed to give a cost that is lower than the optimal cost, but still greater than the MST because by adding in the two closest distances, we create the shortest possible cycle to connect the removed vertex (and the rest of the vertices are connected using the MST) while the optimal tour has to go all the way around to create a cycle.
+In this example, the blue line represents the Nearest Neighbor heuristic solution, the blue dot represents the removed vertex and the green line represents the One Tree.
+
+
+
+Another thing we can do to ensure that the One Tree Lower Bound is maximized (since we want it as close as possible to the optimal tour cost) is to calculate the one tree, but we remove a different vertex each time until all the possible one trees have been determined.
+Using this one tree cost, we can now determine a better approximation ratio.
+In this example, the `One Tree Lower Bound Cost = 1,734.686` and the `Tour Cost = 1,994.528`. We can now determine the approximation ratio by simply dividing the tour cost by the One Tree Lower Bound Cost.
+
+
+`Tour Cost / One Tree Lower Bound Cost = 1,994.528 / 1,734.686 = 1.150`
+
+`1.150 * 100% - 100% = 15.0%`
+
+
+In this case, the approximation ratio is `15.0%` of the One Tree Lower Bound Cost! This is a significantly better approximation of how close we are to the optimal tour cost compared to the approximation ratio using the MST.
MST_distance, MST = find_MST(graph)
print("MST_DISTANCE:", MST_distance)
one_tree_time_start = perf_counter()
- # one_tree_distance, one_tree = find_one_tree(graph)
+ one_tree_distance, one_tree = find_one_tree(graph)
lower_bound, one_tree, removed_vertex = find_lower_bound(graph)
one_tree_time_end = perf_counter()
print_info(route, route_time_end - route_time_start, "NN Heuristic", lower_bound,
one_tree_time_end - one_tree_time_start, r=3000)
- display = Display(os.path.join(GRAPH_PATH, filename), route, mst=MST, one_tree=None, removed_vertex = removed_vertex)
+ display = Display(os.path.join(GRAPH_PATH, filename), route, mst=None, one_tree=one_tree, removed_vertex = removed_vertex)
display.show()