CyberV_ASR / VideoMMMU_ASR_large /Science /validation_Math_9.mp4.txt
marinero4972's picture
Upload 301 files
0a5fd4d verified
[0.00s -> 14.51s] What are Hamiltonian cycles in graph theory? That's what we'll be going over in today's Wrath of Math lesson. We'll also talk about Hamiltonian paths and Hamiltonian graphs. You might already be familiar with a similar concept.
[14.51s -> 24.88s] of an Euler circuit, which is a circuit that contains every edge of a graph. A similar question you might ask is if a graph has a cycle
[24.88s -> 37.90s] that contains every vertex of the graph. Such a cycle is called a Hamiltonian cycle. That's what we'll be talking about today and we'll begin by looking at a graph and an example of a Hamiltonian cycle.
[37.90s -> 52.38s] So here's a beautiful graph. I've labeled its vertices A through D. So does this graph have a Hamiltonian cycle, a cycle that contains every vertex? Indeed it does, and you might be able to see one yourself.
[52.38s -> 64.94s] Let me draw one. We could start at the vertex A, and then go to the vertex C, then to the vertex D, then to B, and then back to A, where we started.
[64.94s -> 70.58s] This is a Hamiltonian cycle, a cycle that contains every vertex of the graph.
[70.61s -> 85.20s] When we're talking about simple graphs, cycles are most easily defined as sequences of vertices where consecutive vertices are adjacent and no vertices are repeated except for the first and the last, which are
[85.20s -> 99.01s] equal so let's write out this hamiltonian cycle as a sequence of vertices we start at a then we go to c then we go to d then we go to b
[99.01s -> 113.36s] and then we return to A where we started. So that is an example of a cycle. Now for a cycle like this to be Hamiltonian, the sequence has to contain every vertex of the graph. In this case,
[113.46s -> 123.18s] Of course, it does. AA, CC, DD, B, and then we go back to A. We've got every vertex of the graph in that Hamiltonian cycle.
[123.18s -> 132.61s] If a graph has a Hamiltonian cycle, you might be able to guess. We call it a Hamiltonian graph, or simply a Hamilton graph.
[132.61s -> 145.84s] So this is a Hamiltonian graph. If you want to prove a graph is Hamiltonian, you've got to prove that it has a Hamilton cycle. A cycle like this, that contains every vertex of the graph.
[146.19s -> 159.02s] Something interesting you might notice about a Hamiltonian cycle is that if we delete an edge from the cycle, we're left with a neat sort of path. Let's say we delete this edge here.
[159.60s -> 174.22s] Now we've got a path going from D all the way to C. Let's write that out also as a sequence of vertices. We go from D to B to A to C. This
[174.22s -> 186.13s] is a path that contains every vertex of this graph. Such a path as you might be able to guess is called a Hamiltonian path. So this is a Hamiltonian path.
[186.22s -> 197.73s] Whenever we have a Hamiltonian cycle, we can create a Hamiltonian path by deleting one edge from the cycle. The converse is not necessarily true.
[197.73s -> 204.91s] If we have a Hamiltonian path, we may or may not be able to find a Hamiltonian cycle in that graph.
[205.17s -> 214.45s] Here's a very simple example. Any path graph will do. Let's look at the path graph on four vertices. This path graph
[214.45s -> 223.02s] clearly has a Hamiltonian path we could go from if we label these vertices go from vertex 1 to 2 to 3
[223.02s -> 237.41s] to 4. And that's a path in the graph that contains every vertex. However, there's no Hamiltonian cycle in that graph. Once we get to vertex 4, there's no way that we're going to get back to where we started.
[237.41s -> 242.69s] without passing through vertices and edges multiple times which isn't allowed.
[242.69s -> 256.29s] So if we have a Hamiltonian path, we may or may not be able to get a Hamiltonian cycle in that graph. But if we have a Hamiltonian cycle, we can delete any one edge and end up with a Hamiltonian path.
[256.29s -> 263.09s] Now we mentioned Euler circuits earlier and there is a very nice necessary and sufficient condition
[263.09s -> 277.25s] to know if a graph has an Euler circuit. A graph has an Euler circuit if and only if every vertex in the graph has an even degree. There's no super handy condition like that for Hamiltonian graphs.
[277.25s -> 291.06s] But of course we can talk about some necessary conditions and we could talk about some sufficient conditions. We'll talk about some necessary conditions for a graph to be Hamiltonian in this lesson. So these are conditions that
[291.06s -> 300.56s] If a graph doesn't meet them, then it's not Hamiltonian. If a graph does meet them, it might be Hamiltonian, but we don't know. So let's talk about some.
[300.72s -> 307.97s] One very obvious necessary condition for a graph to be Hamiltonian is that it has to be connected.
[307.97s -> 319.50s] If a graph is disconnected, there's no way it's going to contain a cycle that contains every vertex of the graph, because there's going to be some vertices in another component that you can't get to.
[319.50s -> 331.81s] Another less obvious condition for a graph to be Hamiltonian is that it cannot have any cut vertices. Remember that a cut vertex is a vertex that when deleted
[331.81s -> 345.17s] disconnects its graph so to see why it's necessary that a graph has no cut vertices in order for it to have any chance of being hamiltonian let's come over here and draw a quick diagram
[345.17s -> 359.79s] So suppose we have a graph that has a cut vertex Then we can draw it kind of like this there's some piece of the graph over here and there's some piece over here and they're connected only by
[359.79s -> 373.60s] this cut vertex there might even be you know multiple edges going to that cut vertex but if you delete that vertex cuts the graph leaving two components behind a graph like this certainly cannot be
[373.60s -> 385.89s] Hamiltonian because at some point you're going to have to pass through this cut vertex to get to one piece of the graph and then you're not going to be able to get back to where you started.
[385.89s -> 400.18s] without passing through that vertex again if you start in this piece you're going to have to pass through the cut vertex to get here and then you'd have to pass through it again to get back and that's not allowed if you start at the cut vertex
[400.18s -> 414.16s] and go to either one of the pieces you're going to have a similar problem. So it's another necessary condition a graph needs to have no cut vertices to have any chance of being Hamiltonian. Let's mention one other condition.
[414.16s -> 426.42s] for a graph to be Hamiltonian, one other necessary condition. And actually, before I write out this condition, let's see it in action in this graph here. Let me erase those blue lines.
[426.54s -> 440.80s] And then I'm going to erase this edge that joins A and C. Now what I've just done by erasing that edge is I've reduced the degree of A from 2 to 1. So here's a problem. In a cycle,
[440.80s -> 445.81s] every vertex has to have degree two you got to have one edge going to the vertex
[445.81s -> 457.49s] I say going, you know, informally because we're not talking about directed graphs. But you have to get to a vertex and then you have to leave it and you can't go back. So in a cycle, each vertex has degree two.
[457.94s -> 465.84s] Vertex A in this graph has a degree of 1, so there's no way it's going to be part of a cycle in this graph.
[465.84s -> 473.23s] Thus, there's no cycle in this graph that contains A, and thus there's no Hamiltonian cycle in the graph.
[473.23s -> 483.60s] A vertex with degree one is often called an end vertex or a leaf if we're talking about tree graphs. So this gives us another necessary condition.
[483.73s -> 495.47s] Another necessary condition for a graph to be Hamiltonian is that it can have no vertex v with a degree less than 2. If it has a degree of 1, we've got this situation here.
[495.47s -> 508.78s] If a vertex has a degree of zero, then either the graph is disconnected, which we know is not allowed for it to be Hamiltonian, or it's a trivial graph with just one vertex, which clearly has no cycles.
[509.07s -> 522.48s] So let's quickly, before we go, see a couple examples of families of graphs that are always Hamiltonian. One really obvious one, perhaps the most obvious one, is the family of cycle graphs.
[522.48s -> 532.80s] So here's the cycle graph on three vertices. This very clearly has a Hamiltonian cycle. Go from here to here to here to there. Easy.
[532.80s -> 541.74s] Same thing with if we draw another cycle graph, say the cycle graph on five vertices. Cycle graphs, by their definition, are very clearly
[541.74s -> 552.30s] Hamiltonian. You can find a cycle in this graph that contains every vertex. Now certainly if a graph is Hamiltonian and we add edges to it
[552.30s -> 565.62s] the resulting graph will still be Hamiltonian because whatever Hamiltonian cycle was there before will still exist. Now this leads to the result very easily that all complete graphs
[565.62s -> 577.84s] with at least three vertices are Hamiltonian. Let's add edges to this cycle graph to make it a complete graph. So here's a complete graph on five vertices and you can see clearly
[577.84s -> 589.84s] It's still a Hamiltonian graph because the cycle that was there before is still there. Let me know in the comments if you can think of any other families of graphs that are always Hamiltonian.
[589.94s -> 604.32s] Also let me know if you can think of any more necessary conditions for a graph to be Hamiltonian. It can be as simple and obvious or as complex as you want. I'd be interested to see what you come up with. Now before we go, let me just leave you one...
[604.32s -> 619.26s] example exercise. Oh, and also, I mentioned earlier there are some sufficient conditions as well for a graph to be Hamiltonian. These are conditions that if a graph meets them, we know it's Hamiltonian. But if a graph doesn't meet them,
[619.26s -> 627.70s] we don't know that it's not Hamiltonian. So I'll go over some of those in another lesson. One of them is called Orr's theorem which I'll hopefully have a proof
[627.70s -> 634.67s] I'll have a proof on that theorem out pretty soon. So I hope you'll subscribe so you don't miss that. Now let's see this example problem.
[636.14s -> 649.66s] So here's the question. KMN is the complete bipartite graph where one partite set has M vertices and the other partite set has N vertices. So the question...
[649.66s -> 658.66s] is what must be true about m and n in order for this complete bipartite graph to be Hamiltonian.
[658.66s -> 673.23s] So let me know what you think and justify your response. And you can even write a proof if you want. Let me know down in the comments and I will of course leave an explanation in the description. So I hope this video helped you understand Hamiltonian cycles, graphs, and paths.
[673.23s -> 685.15s] Let me know in the comments if you have any questions, need anything clarified, or have any other video requests. Thank you very much for watching. I'll see you next time, and be sure to subscribe for the swankiest math lessons on the internet.
[685.15s -> 698.00s] And a big thanks to Valo who, upon my request, kindly gave me permission to use his music in my math lessons. Link to his music in the description.
[702.32s -> 711.73s] Too close to be a cop You were so