Would you like to inspect the original subtitles? These are the user uploaded subtitles that are being translated:
1
00:00:08,410 --> 00:00:16,810
‫This video we're going to talk about a common graph problem and we have two popular graphs called Hamiltonian
2
00:00:17,050 --> 00:00:18,790
‫and your paths.
3
00:00:18,850 --> 00:00:23,010
‫And I'm going to first create a very simple graph.
4
00:00:23,600 --> 00:00:36,080
‫I'm just going to have four different nodes and they're all going to be connected by edges.
5
00:00:37,860 --> 00:00:38,760
‫Just like that.
6
00:00:39,020 --> 00:00:39,430
‫OK.
7
00:00:39,430 --> 00:00:50,730
‫Now a Hamiltonian path is a path where every one of the nodes is hit at least once.
8
00:00:50,740 --> 00:00:55,460
‫So we start here at the top.
9
00:00:56,080 --> 00:00:57,510
‫Top left hand corner.
10
00:00:57,820 --> 00:01:01,040
‫And we go and hit this node.
11
00:01:01,730 --> 00:01:04,430
‫Then we go hit this node.
12
00:01:04,630 --> 00:01:14,110
‫This one this one and then back and if we actually do go back to the middle like we did right here.
13
00:01:14,230 --> 00:01:20,420
‫This is actually called a Hamiltonian cycle in it's a MP complete problem.
14
00:01:20,770 --> 00:01:25,690
‫You have to work with those but that's a Hamiltonian path.
15
00:01:25,870 --> 00:01:36,640
‫Now a Euler path and I know it looks like ular but it actually is pronounced oilor like o i l e r an
16
00:01:36,730 --> 00:01:44,930
‫Euler path is where every one of the edges is touched at least once.
17
00:01:44,950 --> 00:01:51,270
‫So it really doesn't care about the nodes at all but the edges are the important thing.
18
00:01:51,280 --> 00:02:05,890
‫So if we start the same spot and we start here with this edge this age this age and this one that would
19
00:02:05,890 --> 00:02:08,060
‫be an Euler path.
20
00:02:08,110 --> 00:02:15,640
‫Now in this case for this type of graph the Euler path and the Hamiltonian path are the exact same.
21
00:02:15,700 --> 00:02:20,080
‫And that's perfectly fine and it happens quite a bit.
22
00:02:20,080 --> 00:02:26,310
‫One important thing to note is that Hamiltonian paths are empty complete where Euler paths are not.
23
00:02:26,320 --> 00:02:33,000
‫It is pretty easy to find Euler paths and the complexity is a lot.
24
00:02:33,000 --> 00:02:34,680
‫It is much better.
25
00:02:34,960 --> 00:02:42,430
‫Now you may think least I thought when I originally heard this that well every Hamiltonian path and
26
00:02:42,430 --> 00:02:44,730
‫every Euler path have to be the same right.
27
00:02:45,010 --> 00:02:52,480
‫Because you think that if it hits has it every edge has to hit every node and vice versa.
28
00:02:52,480 --> 00:02:55,330
‫However if you draw a different type of graph
29
00:03:06,310 --> 00:03:15,310
‫and you draw edges on the graph here here here
30
00:03:17,890 --> 00:03:18,430
‫here
31
00:03:24,890 --> 00:03:35,030
‫like so then what you're going to have is a different Hamiltonian path versus an oil or path and I'll
32
00:03:35,030 --> 00:03:39,550
‫show you how that's going to work right here.
33
00:03:39,620 --> 00:03:53,180
‫So we'd start with the Hamiltonian all the way on the left and jump to this node node node this node
34
00:03:54,710 --> 00:03:55,360
‫node.
35
00:03:55,580 --> 00:04:07,410
‫Now because we need a Hamiltonian path we can only hit one node only one time.
36
00:04:07,430 --> 00:04:10,940
‫We can't come back to this node right here.
37
00:04:10,940 --> 00:04:24,740
‫And so if there is not a if there would not be an edge right here then the final node of the Hamiltonian
38
00:04:24,740 --> 00:04:31,500
‫path would actually be right here which means there wouldn't really be a Hamiltonian path for this graph.
39
00:04:31,580 --> 00:04:38,270
‫And that's a very important thing to know because knowing if there is a path is just as important as
40
00:04:38,270 --> 00:04:39,340
‫finding it.
41
00:04:39,830 --> 00:04:43,570
‫So that's now that's with the Hamiltonian.
42
00:04:43,580 --> 00:04:50,300
‫Now with the Euler path though you can see it doesn't care if it visits the same node twice all it cares
43
00:04:50,300 --> 00:04:51,080
‫about is edges.
44
00:04:51,080 --> 00:05:03,260
‫So we would come here here here here here we could go back up to this one here and here.
45
00:05:03,260 --> 00:05:12,610
‫So this is a valid Euler path but it is not a valid Hamiltonian path.
46
00:05:12,610 --> 00:05:14,460
‫It's not a Hamiltonian cycle.
47
00:05:14,510 --> 00:05:21,350
‫So this is just part of the reason why it's a lot easier to find Euler paths compared to Hamiltonian
48
00:05:21,350 --> 00:05:29,540
‫just because mathematically it's a lot easier to find a edge is visited or it's possible to visit an
49
00:05:29,540 --> 00:05:38,810
‫edge and also it allows for the same location the same node to be visited multiple times depending on
50
00:05:38,810 --> 00:05:42,860
‫how many edges that it has coming to and from it.
51
00:05:42,860 --> 00:05:50,070
‫So this is a very basic introduction to the differences between Hamiltonian versus Euler past.
52
00:05:50,070 --> 00:05:52,650
‫Please let me know if you have any questions whatsoever.
53
00:05:52,820 --> 00:05:54,110
‫And also in the next video.
5518
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.