 The original problem in graph theory concerned the following problem. The city of Kenigsberg, on the banks of the Praegel River, had several bridges. Is it possible to walk through the city, nose swimming, and cross each bridge exactly once? The problem was first solved by Leonard Euler. Euler's work on the subject is a good example of how mathematics develops. It's worth keeping in mind that you shouldn't actually try to learn mathematics. Instead, you should learn how to create mathematics. To gain a better understanding of the process, we'll approach this problem, as Euler did, without knowing the answer, and without having a language to describe the problem. The first step is realizing that the essential relationship is whether or not two locations have a bridge between them. So it can reduce the complexities of a map of Kenigsberg down to its essentials, and we can simply label the locations A, B, C, and D, and we can also label the bridges with lowercase letters A through G. And this allows us to describe any path as a sequence, letters representing the locations and the bridges. So we might start at A, cross bridge C to C, cross bridge G to D, cross bridge F to B, cross bridge A back to A, and so on. So consider a location A with any number of bridges onto it. If our path uses all the bridges, how many times will this location A appear? Now if there's an odd number of bridges, then the trail must begin or end at the location. That's because if we don't start at the location, then each time we visit and leave, we'll eliminate two bridges. Eventually, we'll take the last bridge in and be unable to leave. Euler could have stopped here, since in the original problem, all four locations have an odd number of bridges leading to them. And what would happen is we'd start at one location and at another location, but there would be two locations we couldn't have taken all the bridges to. But the goal isn't to solve the problem. Remember, it's the journey, not the destination. So let's take on this a little bit more. If there's only one bridge to a location, then the path will either begin on the location, and so the location would be the beginning of our path, or end on the location, and so our path would finish with A. And in either case, the location will appear once. If there are three bridges, then the path either begins or ends on the location, and the location will appear once more when the other two bridges are used. So it'll either appear once at the beginning, and then once more someplace in the middle, when the other two bridges are used, or it'll appear once in the middle, and then once at the very end, when the last bridge is taken, so the location appears twice. If there are five bridges, then the location must appear three times, and in general, if there are two k plus one bridges, the location must appear k plus one times. Thus, in a path through Kennecksberg, A has five bridges into it, so it must appear three times, B has three bridges into it, so it must appear twice, C also has three bridges, so it must appear two times, and likewise D, and so our path must include three As, two Bs, two Cs, and two Ds. Since a bridge must appear between each letter, this means we need eight bridges, but we only have seven bridges, so it's not possible to cross all bridges exactly once. While none of the Kennecksberg locations have an even number of bridges leading to them, or they're considered this case anyway, with two bridges, if the path begin at the location, it would appear twice, otherwise it would appear once, and in general, with two N bridges, the location would appear N plus one or N times, depending on whether we started there or started someplace else. Euler turned this into an algorithm for deciding if it was possible to find a path crossing each bridge exactly once. Write down the locations of the number of bridges leading to them, if the number is odd, add one and divide by two, if the number is even, divide by two. If the sum is not equal to the number of bridges plus one, then it is not possible to find a path that crosses each bridge exactly once. For example, let's analyze the map shown, and we have our locations A through F, and we count the number of bridges leading to each location. So A has eight bridges, B has four, C has... Now since D and E have an odd number of bridges, then we add one and divide by two. The remaining numbers are even, so we divide by two. And we might also note that since D and E have an odd number of bridges, any path that uses all the bridges must start at one and end at the other. And so any path must include four A's, two B's, two C's, two D's, three E's and three F's, passing through a total of, and this requires 15 bridges, and since we have 15 bridges, a path crossing each bridge exactly once is possible. Or is it? Actually, Euler's algorithm only proves that it's not impossible to find a path crossing each bridge exactly once. We would call this a necessary condition. But just because it's not impossible, it doesn't mean that it is possible. For that, we'll need to introduce more graph theory.