 The key feature of a graph is the relationship between the edges and the vertices. We define the following. The degree of a vertex is the number of edges incident on it, and an isolated vertex is one with degree zero. So we might try to find the degrees of the vertices in the graph shown, and for that we'll just count the number of incident edges. So vertex one has three incident edges. Vertices three, four, and five have, and these will be the degrees of the different vertices. In his solution to the Kennecksberg bridge problem, Euler observed in modern terms, the sum of the degrees of all vertices in a graph is twice the number of edges. That's because every edge increases by one the degree of two vertices, and this leads to a remarkable result known as the handshake theorem. Suppose you're at a party with 100 people. Actually, the number of people doesn't matter. At the end of the night, everyone has a handshake number, the number of other people they shake in hands with at least once. The handshake number can be anything between zero and whatever. Can we say anything about the handshake numbers? Let's hope so, since otherwise I don't know how I'm going to fill up the rest of the time. So remember a graph represents connections between objects, so we can let the vertices represent the partygoers, and if two partygoers have shaken hands, we can put an edge between them, so all the handshakes of the party can be represented using a graph. Now to avoid learning anything, skip ahead to 6.18. But remember, it's the journey, not the destination. You shouldn't try to learn mathematics, you should learn how to create mathematics. And a useful approach, if you build it, they will come. So to analyze the problem, let's gather some data, and let's start with a small case. Suppose there's four people, and we'll use an ordered four tuple to record the degree of each vertex as people shake hands. So initially, everyone has degrees zero, and so we can represent her degree of four tuple, but sooner or later, someone shakes hands, and we'll put an edge between the people who've shaken hands, and now our four tuple will be, and maybe they shake hands with someone else, making our degree tuple, and as the party continues, some partygoers increase their degree. Now notice that every time two people shake hands, both of their degrees increase by one. This means the degree some must increase by two, but since the degree some started at zero, then the degree some must always be an even number. Now, some degrees are even, and some degrees are odd, but since the sum of all the degrees is even, then the number of odd degree vertices must be even. And this gives us the handshake theorem. In any graph, the number of vertices with odd degree must be even. A useful strategy for learning to create mathematics. Once you've proven something, prove it again in a different way, and then find more proofs. The first proof relied on the fact that adding an edge increased the degree sum by two. Can we use the fact that it increased the degrees of two vertices by four so that it increased the degrees of two vertices by one? So again, let's add an edge between two vertices. There are three cases. Both vertices had odd degrees, both vertices had even degrees, and one vertex had an odd degree, and the other had an even degree. If both vertices had odd degree, both would now have even degree, so the number of odd degree vertices would decrease by two. If both vertices had an even degree, both would now have an odd degree, so the number of odd degree vertices would increase by two. And if one vertex had an odd degree, and the other had an even degree, the first would have even degree, and the other would have odd degree, so the number of odd degree vertices would be unchanged. And so summarizing, if we add an edge to an odd, odd pair, the number of odd vertices decreases by two. If we add an edge to an even, even pair, the number of odd vertices increases by two. And if we add an edge to an odd, even pair, the number of odd vertices stays the same. Since the number of odd vertices is initially zero, this means it will either increase by two, decrease by two, or stay the same, and so the number of odd vertices must be a multiple of two. And again, this gives us the handshake theorem. But in fact, we can prove the handshake theorem in a third way. Since the degree sum is even, then the number of vertices of odd degree must be even. And consequently, in any graph, the number of vertices with odd degree must be even.