AIHL 3.16.6 Chinese Postman problem | Free Mathematics Applications & Interpretation (AI) Video | RevisionDojo
Free video lessonIB · Mathematics Applications & Interpretation (AI)
AIHL 3.16.6 Chinese Postman problem
Learn AIHL 3.16.6 Chinese Postman problem in this free IB Mathematics Applications & Interpretation (AI) video lesson for AHL 3.16—Tree and cycle algorithms, Chinese postman, travelling salesman.
Learn AIHL 3.16.6 Chinese Postman problem in this free IB Mathematics Applications & Interpretation (AI) video lesson for AHL 3.16—Tree and cycle algorithms, Chinese postman, travelling salesman.
The video discusses the Chinese Postman Problem, which involves finding the shortest route to traverse all edges in a graph and return to the starting point. The problem is illustrated through three examples, starting with an Eulerian graph where all vertices have even degrees, allowing for a straightforward solution by summing the weights of all edges.
In the second example, a new edge creates vertices with odd degrees, necessitating the repetition of an edge to form an Eulerian graph. The shortest path is determined by connecting odd-degree vertices in the most efficient way.
The final example involves a more complex graph with eight towns, where the odd vertices are identified, and various combinations are evaluated to find the shortest connections. The total distance is calculated by summing the weights of the edges traversed, resulting in a final distance of 174 kilometers.
00:00Hi guys, so in this
00:02lesson we are going to
00:03look at the Chinese postman
00:05problem. It is called the
00:07Chinese postman problem because it
00:08was originally studied by the
00:10
Chinese mathematician, my cool quan,
00:15that is my best guess
00:20at a pronunciation, apologies if
00:22I am significantly off. Anyway,
00:25the problem is kind of
00:28a
00:28explained in this example, it
00:31is to find the shortest
00:32possible route. It takes to
00:37traverse all the edges in
00:40a graph. So it might
00:42be a postman that wants
00:44to walk along every road
00:46and return back to where
00:49he started, what is the
00:51shortest possible route he can
00:52take. And that's it. So
00:55this example I'm going to
00:56go through three examples. First
00:57one's easy. Second one is
00:59less easy and the third
01:00one is the more difficult
01:01of the three. Here, we
01:04have a national park. There
01:05are six places of interest.
01:07The weight of the edges
01:08represent the time in minutes
01:10to, it takes to walk
01:12along the path between adjacent
01:13vertices. Determine the least amount
01:15of time. It would take
01:16a visitor to walk on
01:16every path. Visit all six
01:19places of interest and return
01:20to the same place where
01:21you started. Now, yes, we
01:22are going to visit all
01:23the places of
01:24interest because he's gonna walk.
01:27If you're gonna walk along
01:28all the edges, you are
01:29gonna reach all the vertices.
01:31But note, the Chinese postman
01:33problem is particularly interested in
01:40edges, right? So the least
01:43amount of time, it'll take
01:45the visitor to walk along
01:46every path that is the
01:48main thing that we're looking
01:49at. Okay, now,
01:52This is very much connected
01:54to the previous lesson which
01:55was Eulerian graphs. Because if
02:00it is an Eulerian graph
02:01which this one is, the
02:02shortest, so this is an
02:04Eulerian graph, then the shortest
02:07possible way to travel across
02:12every edge, travel along every
02:15edge and return to where
02:16you were, the shortest possible
02:18way is just simply to
02:20add up
02:20all these times because you
02:22have to walk along all
02:23of them and you know
02:26you can walk along all
02:27of them and return back
02:29to where you started because
02:30it's an island area in
02:31graph. I know this is
02:32an island area in graph
02:33because this is the exact
02:35same graph I used in
02:37the previous lesson where I
02:38was explaining what an island
02:39area in graph is but
02:40if it wasn't I know
02:42it's an island area in
02:42graph because every vertex is
02:45an even vertex or has
02:47is of an even
02:48So this is 4 edges,
02:512 edges, 4 edges, 2,
02:534 and 2. It is
02:54an hard angle graph. Therefore,
02:56the shortest route is just
02:58the sum of all these
02:59times. So it's 7 plus
03:014 plus 10 plus 5
03:04plus 7 plus 6 plus
03:066 plus 5 plus 8.
03:11And this equals 11, 21,
03:1626.
03:16633 .49. 45 .50 .58.
03:23So it's 58 minutes is
03:25the shortest amount of time.
03:26And as I say, that
03:27one is straightforward because it's
03:29an ordinary graph. Second example,
03:33exact same example, except there's
03:36now a new path from
03:37B to D. So if
03:40we are going to start
03:44and finish in the same
03:46vertex and walk along every
03:53edge in the graph. Then
03:57I am going to have
03:59to repeat an edge. I
04:00know that because this is
04:01not an Arlarian graph and
04:03I know this is not
04:04an Arlarian graph because not
04:06all the edges are even
04:09degree because I've just drawn
04:10this new line here and
04:11this is now degree three.
04:12and this is degree three.
04:15So I can't start finishing
04:16the same place and travel
04:19through along the edges without
04:21repeating an edge. So what
04:23I need to do is
04:25I need to decide which
04:29edge I'm going to repeat.
04:32And the way to do
04:33it is I look at
04:34my vertices that have an
04:40odd degree
04:40and I connect them. I
04:43need to join B to
04:44D and that way if
04:47I join B to D,
04:49like let's give that me
04:50a giving example. If I
04:51just join B to D
04:52like this now and this
04:53is 15. Now I have,
04:57and this is like I'm
04:58just going to basically repeat
04:59this, this edge twice, which
05:02is 15 plus 15. Now
05:04I have an Eulerian graph
05:06and I know I can
05:08start and finish
05:08in the same, at the
05:11same vertex, I can start
05:13and finish at the same
05:14vertex, and travel along every
05:19edge. However, there's a problem.
05:24This is not necessarily the
05:26quickest way to get from
05:27B to D, and I've
05:28deliberately put in a way
05:32that is quicker. So,
05:36To get from B to
05:39D, yes, it's 15 along
05:42this edge, but what about
05:44instead of going on this
05:45edge, I went from B
05:47to C and then C
05:49to D. So let's do
05:50that. I'll put in this
05:52edge and pink actually. I'm
05:53going to go from B
05:54to C and I'm going
05:57to go from C to
05:59D. So I'm going to
06:00connect the two, the two
06:04vertices.
06:04that have an odd degree
06:07but I'm going to connect
06:08them in the shortest possible
06:09way and in this case
06:11it's not directly it's actually
06:13going through C so I
06:14hope that makes sense. Now
06:15in an exam it says
06:18you can get up to
06:21four vertices of an odd
06:24degree and that's what I'm
06:24going to show you in
06:25the next in the next
06:27example and it's so more
06:29difficult of the three obviously.
06:31So now that I've put
06:32in the
06:33Z edges all I have
06:34to do is add up
06:36the total. So the total
06:38is now I actually have
06:41this 58. So it's just
06:43going to be 58 plus
06:465. So all the greens
06:48are 58 plus 5 plus
06:508, which is 63 plus
06:538, 71. So it's 71
06:57minutes.
07:01Done. Last example. The below
07:06graph shows eight towns in
07:07France, so these are the
07:08eight towns that we see
07:09the E of G, H,
07:11and the roads joining them.
07:12The weights of the edges
07:13represent the distance in kilometers,
07:16lower lives in town A,
07:17she wants to drive along
07:18every road before returning to
07:20A. Use the Chinese post
07:21-round algorithm, clearly showing all
07:24the stages to find the
07:25shortest distance required to travel
07:26in order to drive along.
07:29every vote and write down
07:31a possible root. Okay, so
07:33this is the example where
07:37I said you could have
07:39up to four vertices that
07:42are odd so that would
07:44be an odd number of
07:46odd number of ages joining
07:49them. So the first thing
07:50we need to find out
07:51is one of the odd
07:52vertices. Let's write that down.
07:56Odd
07:57So the odd vertices, the
08:01odd vertices are A, because
08:04there's only three there. B
08:07is fine. C is odd,
08:12and D is odd. E
08:15is fine. This is 4,
08:17F is even. G1, 2,
08:193, 4, 5. G is
08:21odd, and H is even.
08:23So obviously,
08:25odd means there's one three
08:28five seven whatever edges even
08:30means it's two four six
08:31setters right so our odd
08:33vertices are a c d
08:34and g so what we
08:36need to do is connect
08:38and edge from one of
08:41the odd vertices to the
08:42other but we need to
08:44do it in the way
08:44that gives us the shortest
08:46possible route so the only
08:47way to do this is
08:49to figure out what is
08:52what would be
08:53the shortest way to connect
08:55two pairs of edges. So
08:57what, the only way to
08:58do it is to look
08:59at all the different combinations.
09:02So we could have, we
09:03could connect A to C
09:05and D to G, that
09:09would be fine. Or we
09:11could connect A to D
09:13and A to D and
09:17C to G. Or we
09:20could do A
09:21e to g and c
09:27to d. And that's actually,
09:29that's it. There's only three
09:30combinations. There's no other, I
09:32don't have any other combinations.
09:34So a, a, c, d,
09:36g, a, d, c, g,
09:38and a, g, c, d.
09:39All right. Now though, we
09:41need to figure out how,
09:42well, we need to figure
09:43out which is the shortest
09:45of these three combinations. So,
09:49If I connect A to
09:52C, what's the shortest possible
09:54root from A to C?
09:56Well, it's either going to
09:58be the 9 plus 20,
09:59which is 29, or the
10:025 plus 5 plus 15,
10:04which is 25, so it's
10:05actually going to be that
10:06one. I mean, you could
10:07do the 5, 10, 20,
10:08but that's going to be
10:09more. So it's 5 plus
10:105 plus 25 plus 5
10:12plus 15, which is 25.
10:14So this is 25 plus
10:16the D to the
10:17G, the shortest way is
10:19definitely the 12, because any
10:21other, it's 14 and 15,
10:23so it's 12, so it's
10:2425 plus 12. That's obviously
10:27equal to 37. Okay, then
10:31we could do the a,
10:33d, the a to d,
10:36and the c to g.
10:39All right, what's the quickest
10:40way to get from a
10:41to d? Well, I could
10:42do the 5, 5, 12,
10:44or I could do the
10:459, 2014, that's not going
10:47to work. It's going to
10:49be the 5, 5, 12.
10:50So 5, 5, 12 is
10:5122 plus the CG. Again,
10:56it's definitely going to be
10:57the 15. So this is
10:5927. Now you could go,
11:02it's, you could look it
11:03and go right guys, it's
11:04definitely going to be this
11:05one. This is 27 and
11:07even look at this and
11:08say that, it's not going
11:09to be this. But that's
11:10not good enough. You have
11:11to show even the one,
11:13even if
11:13You know what's going to
11:14be this one? You have
11:15to show what this one
11:17would be. What would be
11:19the shortest way to connect
11:20A to G and C
11:21to D just to be
11:22clear that you're choosing this
11:23one because it's the shortest
11:24one. So A to G
11:27is 10. I might be
11:28wrong actually. Maybe this one's
11:29quicker. A to G is
11:31just 10. That's my 5
11:32plus 5, which is 10.
11:35And my C to D
11:38is 14. You actually have
11:40wrong. This one's going to
11:41be
11:41a quicker C to the
11:45C to D is 14.
11:48So it's 10 plus 14,
11:50which is 24. So that's
11:51actually the shortest route. So
11:52definitely you want to check
11:53them all. That's because you
11:54never know. So this is
11:57the one I'm going to
11:58choose. So I'm going to
11:59connect A to G by
12:01going A to H and
12:02H to G. And I'm
12:03going to connect C to
12:04D by just going straight
12:05across. So let's do that.
12:07I'm going to do that
12:08to this.
12:09I'm gonna do this to
12:12this not like that like
12:16this and then this guy
12:20to this guy. Okay, now
12:23I'm gonna add in what
12:24these are this is gonna
12:28be five. This is gonna
12:32be five and this is
12:35gonna be 14.
12:38Okay, so then it says,
12:43use the Chinese post -naga,
12:45clearly showing all the stages
12:46to find the shortest distance
12:48required to travel in order
12:49to drive along every road.
12:51So we're gonna, you're gonna,
12:52she's gonna start a day
12:54and return to a and
12:55drive along every road. So
12:57essentially all you have to
12:58do now is add up
12:59all these numbers that you
13:00see in front of you,
13:02all the purple ones plus
13:03the five plus the five
13:04plus the 14. But he
13:06said,
13:06is to also write down
13:07a possible root. So let's
13:08just do a root. So
13:11I'll write it down first
13:13and then I'll kind of
13:14go over it in pink
13:15just to make sure we're
13:16correct. So I could do
13:18A to E to D
13:23to C. And let's go
13:27back to D. So I'm
13:30going D to C back
13:32to D over to G.
13:34Let's go to F. Let's
13:36go to E. Let's go
13:39to H. Let's go to
13:42G. So I'm back to
13:46G here. Let's go to
13:48C. So now let's see,
13:53then let's go to B.
13:55Let's go back to G.
13:59So I've got over here
14:00to G.
14:02Let's go back to H.
14:07So I'm going to go
14:09back to H. Then I'm
14:12going to go back to
14:16B, up to A, down
14:20to H. I'm back to
14:22A. I think that was
14:24right. And I've covered every
14:26possible one out. That's definitely
14:28not the only option. In
14:29fact, there's loads of options.
14:30You can go here first,
14:32then here you can do
14:33there's loads of nodes and
14:34nodes of different options. There
14:35are different routes that you
14:36could take. Let's just let's
14:37just do that route with
14:39pink just to make sure
14:40we're right. So A to
14:41E goes to there. E2D
14:46does this. Fine. D to
14:51C. Oops, that's not what
14:53I should do. D to
14:55C does this. Good.
14:58C to D does this,
15:03D to G, G to
15:06F, F E, E, H,
15:13and G, then C, then
15:20B, then G, back to
15:25H,
15:26Then B, then A, then
15:35H, and back to A.
15:40Nice. So we walked, we
15:41started at A, we walked
15:42on every single edge exactly
15:44once, and we finished an
15:48A, which is just what
15:49I wanted. So all I
15:50have to do now, the
15:51shortest distance required,
15:54is the shortest distance. Shortest
16:07distance is, and I just
16:09basically need to add up
16:12all these numbers. So let's
16:15do just that. It is
16:1610 plus 15 plus 14.
16:21I'll do it in the
16:22order I did it, plus
16:2414, plus 12, plus 10,
16:32plus 7, plus 6, plus
16:375, plus 15, plus 20,
16:43plus 12, plus 5, plus
16:4810,
16:50plus 9 plus 5 and
16:58plus 5 again gives us
17:01174. So this shortest distance
17:03is 174. Obviously you don't
17:05even have to add them
17:06in order. Just literally add
17:08up the numbers and you
17:09know it's the shortest possible
17:11distance. Okay, that's it guys.
17:13I hope that makes sense.
17:16Yeah, that's it. I'll see
17:17you in the next video.
17:18you
About this video
Video transcript
Chapters
Keep learning for free
Create a RevisionDojo account to save videos and track your study progress.