graphs & networks route inspection the chinese postman problem route planning map colouring

20
Graphs & Networks Route Inspection The Chinese Postman Problem Route Planning Map Colouring

Upload: imani-hannaford

Post on 31-Mar-2015

245 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Graphs & Networks Route Inspection The Chinese Postman Problem Route Planning Map Colouring

Graphs & Networks

Route Inspection

The Chinese Postman ProblemRoute PlanningMap Colouring

Page 2: Graphs & Networks Route Inspection The Chinese Postman Problem Route Planning Map Colouring

Where graph theory came from…

The city of Königsberg in Prussia (now Kaliningrad, Russia) was set on both sides of the Pregel River, and included two large islands which were connected to each other and the mainland by seven bridges.The problem was to find a walk through the city that would cross each bridge once and only once. The islands could not be reached by any route other than the bridges, and every bridge must have been crossed completely every time (one could not walk half way onto the bridge and then turn around and later cross the other half from the other side).

Page 3: Graphs & Networks Route Inspection The Chinese Postman Problem Route Planning Map Colouring

Where graph theory came from…

Page 4: Graphs & Networks Route Inspection The Chinese Postman Problem Route Planning Map Colouring
Page 5: Graphs & Networks Route Inspection The Chinese Postman Problem Route Planning Map Colouring

• The Chinese Postman algorithm was invented in 1962 and takes its name from the Chinese mathematician Kuan Mei-Ko who considered the problem of a postman who has to deliver mail to houses along each of the streets in a particular housing estate and wants to minimise the distance he has to walk.

• He must return to his starting position

Page 6: Graphs & Networks Route Inspection The Chinese Postman Problem Route Planning Map Colouring

Traversability• A network is said to be Traversable if you can draw it

without removing your pen from the paper and without retracing the same arc twice.

Are these Graphs Traversable?

Page 7: Graphs & Networks Route Inspection The Chinese Postman Problem Route Planning Map Colouring

No Yes Yes

What is the difference between the 3 graphs?

What is the difference between the 3 graphs?

Page 8: Graphs & Networks Route Inspection The Chinese Postman Problem Route Planning Map Colouring

To be traversable it must have 2 or 0 odd nodes

• In order to start and end at the same node the network must be Eularian (all nodes must be even).

• If exactly two nodes have odd order, the network is still traversable, but you start and end at different nodes (and the network is Semi-Eularian)

To be route for a postman it must be closed and so have 0 odd nodes

Page 9: Graphs & Networks Route Inspection The Chinese Postman Problem Route Planning Map Colouring

Traversability• A network is said to be Traversable if you can draw it without

removing your pen from the paper and without retracing the same arc twice. It is Closed if you can start anywhere and finish at the start point.

Are these Graphs Traversable? Are they closed?

Yes Yes Yes

No Yes Yes

Traversable?

Closed?

Page 10: Graphs & Networks Route Inspection The Chinese Postman Problem Route Planning Map Colouring

For each network, count the number of odd vertices and the number of even vertices, then complete the table.

Network Number of even vertices

Number of odd vertices

Traversable? Closed?

Page 11: Graphs & Networks Route Inspection The Chinese Postman Problem Route Planning Map Colouring

Notes…

• If the graph in question is closed then such a trail is easy to find. However, many graphs are not closed and this is where the problem becomes more interesting.

• Such a network can be made closed by linking together pairs of odd nodes with additional arcs. The effect of adding these extra arcs is to make all nodes even and thus the network is now closed.

This graph has four vertices of odd order and so it is not closed or traversable.

Page 12: Graphs & Networks Route Inspection The Chinese Postman Problem Route Planning Map Colouring

We need to pair the vertices together by adding an extra edge to make the order of each vertex four. We can join AB and CD, or AC and BD, or AD and BC.

In each case the graph is now closed.

[You only need to add one arc to be traversable]

Page 13: Graphs & Networks Route Inspection The Chinese Postman Problem Route Planning Map Colouring

If the length of each road is 1 mile, find the length of an optimal Chinese postman closed route for these networks

Starting and finishing at A write down one solution such as ABGC….

Draw extra line from B to C9 miles: One route is AFEDCGBCBA

Draw two extra lines B to C and E to F12 miles:One route is: AFGEFEDCGBCBA

12 miles:One route is: ABCEDCGBFGEFA

Page 14: Graphs & Networks Route Inspection The Chinese Postman Problem Route Planning Map Colouring

A groundsman at a local sports centre has to mark out the lines of several five-a-side pitches using white paint. He is unsure as to the size of the goal area and he decides to paint the outline as given below, where all the distances are in metres.

He starts and finishes at the point A. Find the minimum total distance that he must walk and give one of the corresponding possible routes.

Draw an extra route from B to E180 metres: One possible route: ABEBCDEFA

Page 15: Graphs & Networks Route Inspection The Chinese Postman Problem Route Planning Map Colouring

A local council is responsible for gritting roads.The following diagram shows the lengths of roads, in miles, that have to be gritted.

He starts and finishes at the point A. Find the minimum total distance that he must drive and give one of the corresponding possible routes.

Draw an extra route from D to E and D to C80.5 miles: One possible route: ABFEBCDEDCA

Page 16: Graphs & Networks Route Inspection The Chinese Postman Problem Route Planning Map Colouring

Find the length of an optimal Chinese postman route for thenetworks below. Start and end at C.

43

93

Page 17: Graphs & Networks Route Inspection The Chinese Postman Problem Route Planning Map Colouring

There are many variations to the Chinese Postman Problem, most notably whether the roads are one-way

Directed Chinese Postman Problem

Taking each arc to be of equal weight, one optimal closed Chinese Postman Tour of this graph is: 0, 1, 3, 0, 1, 2, 3, 0, 2, 3, 0, traversing 10 arcs.

A least cost open tour is:1, 3, 0, 1, 2, 3, 0, 2, which traverses only 7 arcs.

Page 18: Graphs & Networks Route Inspection The Chinese Postman Problem Route Planning Map Colouring

Is it possible to plan a walk in which each door is passed through exactly once?

Each room is represented by a vertex point. Notice that a vertex (point P) is needed to represent the region outside the floor plan.

Now we need to count the order of each of the nodes.

Route Planning Problem

Page 19: Graphs & Networks Route Inspection The Chinese Postman Problem Route Planning Map Colouring

Is it possible to plan a walk in which each door is passed through exactly once?

Can you start inside or outside the building?

Page 20: Graphs & Networks Route Inspection The Chinese Postman Problem Route Planning Map Colouring

Graph Coloring Problem

Your mission color the entire map of South America.1. No country may touch another country of the same color.2. You will be charged each time you use a color3. You must color the map as cheaply as possible.We start with the graph representation: vertices represent countries. Two vertices are adjacent if two countries have a common boarder. So we reduce a problem to vertex coloring.Adjacent vertices must be colored in different colors.