 Since every edge in a tree is a bridge, we can regard trees as minimally connected. In some sense they're the most efficient way of connecting the vertices. So given a graph G, can we find a spanning tree? A tree that includes all the vertices and as many edges as necessary. And this leads to an important consideration in graph theory. In solving problems in graph theory, there are two common approaches. breadth-first, where we go from a vertex and we investigate all adjacent vertices. And then there's depth-first, from a vertex, investigate one adjacent vertex. And in both cases, lather, rinse, repeat. We could use a breadth-first approach to find a spanning tree, or a depth-first approach. And in fact, we'll use both. A breadth-first search would begin at a vertex and expand to include the connected vertices. Then lather, rinse, repeat, until we've included every vertex. Intuitively, if we're going to do this we want to expand as quickly as possible so it makes sense to go to the vertex with the most edges incident. So let's use a breadth-first approach to find a spanning tree. So to perform a breadth-first search, we'll begin with the vertex of highest degree and expand to include all its neighbors. So we find the vertex of highest degree and expand. This gives us the first two edges in our spanning tree. Now we'll eventually go to every one of these adjacent vertices, but again if the goal is to expand our network as quickly as possible, we'll go to the neighbor with the highest degree and expand to include all its neighbors. And so the vertex of highest degree is this one and we'll expand. And notice that at this point we've included all of our vertices and so any edges we haven't used are irrelevant and we can drop them to get our spanning tree. In contrast, a depth-first approach would begin at a vertex and then investigate one adjacent vertex and again and again. If all adjacent vertices have been investigated, we'll back up a step, then lather, rinse, repeat until all vertices have been investigated. And intuitively, because we do have to check out the adjacent vertices, we'd choose the vertex with the fewest incident edges. So if we wanted to use a depth-first to find the spanning tree for this graph, we'll start at the vertex with the fewest edges. And that's one of these two, so we'll start here. And then from there, we'll go to the adjacent vertex with the fewest edges, well, not really any choice, we have to go here. And we'll look at our adjacent vertices and we'll go to the one with the lowest degree, which is this one. And at this point, we can't go any further. So in a depth-first search, if there are no adjacent vertices unvisited, go back a step and choose another vertex. So we'll go back one step and now, again, go to the vertex with the lowest degree. From here, we don't really have any choice, we have to go to this vertex. And from here, again, we have a choice of two vertices. So we'll go to one of them. And finally, there's only one vertex remaining, so we'll go there. And we produce our spanning tree. Now, don't forget the first spanning tree looked like this. And notice the two approaches give us different spanning tree. And in general, the correct approach to use is whichever one works better. And so the question you've got to ask yourself is, what type of spanning tree do we want?