Route Inspection
description
Transcript of Route Inspection
Route InspectionChinese Postman Problem
Objectives
4.1 Determine whether a graph is traversable
4.2 Use the route inspection (Chinese postman algorithm to find the shortest inspection cycle in a network).
4.1 Determine whether a graph is traversable
degreeOrder of a vertex
valency
The degree or valency or order of a vertex is the number of arcs incident to it.
2.2 Basic terminology used in graph theory• Vertices (or nodes)
• Edges (or arcs)• Edge set• Subgraph
• connected
• Degree (or valency, or order of a vertex)
• Walk
• loop
• Not connected
• Even degree• Odd degree
• Cycle (or circuit)
• Path
• Simple graph• Digraph• Directed edges
• Vertex setIf the degree of a vertex is even, we say it has even degree, so J, K and M have even degree.
Vertex Degree
J
K
L
M
N
22141
Similarly vertices L and N have odd degree.
In any graph the sum of the degrees will be precisely equal to 2 x the number of edges. This is because, in finding the sum of degrees, we are counting each end of each edge.
This is known as the Handshaking Lemma.
4.1 Determine whether a graph is traversableHow many valencies are there for each vertex?2
4
42
4
4 4
If all the valencies in a graph are even,then the graph is Eulerian.
Is this graph traversable?
A graph is traversable if it is possible to traverse (travel along) every arc just once without taking your pen from the paper.
4.1 Determine whether a graph is traversableHow many valencies are there for each vertex?
If precisely two valencies in a graph are odd, and the rest are even, then the graph is semi-Eulerian.
2 2
4 1
22
41
Is this graph traversable?
A graph is traversable if it is possible to traverse (travel along) every arc just once without taking your pen from the paper.
4.1 Determine whether a graph is traversableWhich of the following graphs are traversable?
1 2 3 4
√ × × √
A graph is traversable if all the valencies are even. A graph is semi-traversable if it has precisely two odd valencies. A graph is not traversable if it has more than two odd valencies.
2
42
4
2
4
2 3
3
32
3 1
1
1
3 1
4 1
13
4
4 2
3
3
4.1 Determine whether a graph is traversableWhich of the following graphs are traversable?
1 2 3 4
√ × × √
A graph is traversable if all the valencies are even. A graph is semi-traversable if it has precisely two odd valencies. A graph is not traversable if it has more than two odd valencies.
2
42
4
2
4
2 3
3
32
3 1
1
1
3 1
4 1
13
4
4 2
3
3
Eulerian semi-Eulerian All Eulerian graphs are traversable. All semi-Eulerian graphs are semi-traversable. In this case the start point and the finish point will be the two vertices with odd valencies.
4.1 Determine whether a graph is traversable
1. a. Verify that the graph is Eulerian.
b. Find a route, starting and finishing at A, that traverses the graph.
a.
Vertex
Valency
A B C D E F G
2 4 4 2 4 4 4
All valencies are even, so the graph is Eulerian.
b. A possible route is:
A, B, C, D, E, C, G, F, E, G, B, F, A.
4.1 Determine whether a graph is traversable
2. Find a route that traverses each arc of this graph just once.
You may start and finish at different points.
C D2 2
33
If a graph is semi-traversable, then the start point and the finish point will be the two vertices with odd valencies.
This graph has precisely two odd valencies, so it is semi-Eulerian.
A possible route is
A, B, D, C, A, B.
4.1 Determine whether a graph is traversable
3. Prove that there must always be an even (or zero) number of vertices with odd valency in every graph.
2.2 Basic terminology used in graph theory• Vertices (or nodes)
• Edges (or arcs)• Edge set• Subgraph
• connected
• Degree (or valency, or order of a vertex)
• Walk
• loop
• Not connected
• Even degree• Odd degree
• Cycle (or circuit)
• Path
• Simple graph• Digraph• Directed edges
• Vertex setIf the degree of a vertex is even, we say it has even degree, so J, K and M have even degree.
Vertex Degree
J
K
L
M
N
22141
Similarly vertices L and N have odd degree.
In any graph the sum of the degrees will be precisely equal to 2 x the number of edges. This is because, in finding the sum of degrees, we are counting each end of each edge.
This is known as the Handshaking Lemma.
4.1 Determine whether a graph is traversable
3. Prove that there must always be an even (or zero) number of vertices with odd valency in every graph.
Each arc has two endsand so will contribute two to the sum of the valencies of the whole graph.The sum of the valencies = Number of arcs × 2The sum of the valencies is even. Any odd numbers must occur in pairs.There is an even number of odd valencies.