If I've shaken hands with you, you've shaken hands with me, so each edge is symmetric. In the other type of graph, known as a directed graph , an edge goes from one of the vertices, towards the other. In this case I'll draw an arrowhead at the vertex towards which the edge is going. Whenever we talk about graphs, we'll use n to denote the number of vertices, and m to denote the number of edges. This notation is confusing, but I'll stick with it because it's very standard.
Any tree is a graph.
This is an example of a directed graph. The same comparison graph notation is useful in solving homework 3.19, which asked you to find an element among the smallest k values among an n -value set. To prove this is optimal, suppose we have found some value x that we know to be in the smallest k values. Therefore, we must be able to show from the comparisons we have made that at least n - k other values are larger than it. We draw a vertex for each member of a family, and a directed edge from each parent to each child.