Top Banner
Spring 2015 Mathematics in Management Science Chinese Postman Problem What is CPP? CPP & ECs & EPs Fleury’s Algorithm Eulerization
31

Spring 2015 Mathematics in Management Science Chinese Postman Problem What is CPP? CPP & ECs & EPs Fleury’s Algorithm Eulerization.

Jan 01, 2016

Download

Documents

Barnaby Stewart
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Spring 2015 Mathematics in Management Science Chinese Postman Problem What is CPP? CPP & ECs & EPs Fleury’s Algorithm Eulerization.

Spring 2015Mathematics in

Management Science

Chinese Postman Problem

What is CPP?CPP & ECs & EPsFleury’s AlgorithmEulerization

Page 2: Spring 2015 Mathematics in Management Science Chinese Postman Problem What is CPP? CPP & ECs & EPs Fleury’s Algorithm Eulerization.

Parking Meter Problem

Blue dots indicate parking meters along certain streets. Meter reader must check each meter. Want efficient route.

Page 3: Spring 2015 Mathematics in Management Science Chinese Postman Problem What is CPP? CPP & ECs & EPs Fleury’s Algorithm Eulerization.

Parking Meter Problem

Create associated graph with just the information we need. Identify corners B’,B” & C’,C” etc; corners become vtxs.

Page 4: Spring 2015 Mathematics in Management Science Chinese Postman Problem What is CPP? CPP & ECs & EPs Fleury’s Algorithm Eulerization.
Page 5: Spring 2015 Mathematics in Management Science Chinese Postman Problem What is CPP? CPP & ECs & EPs Fleury’s Algorithm Eulerization.

Meter reader must traverse each edge of above graph (to read all meters along it).

Would prefer no retracing; want an Euler circuitDoes graph have an Euler circuit?

So, what should meter reader do?

Page 6: Spring 2015 Mathematics in Management Science Chinese Postman Problem What is CPP? CPP & ECs & EPs Fleury’s Algorithm Eulerization.

Chinese Postman Problem

Chinese mathematician Meigu Guan first studied this problem in 1962, hence the name.

The Problem

Given a connected graph, find a minimal length circuit (or path)

traversing all edges of the graph.

Page 7: Spring 2015 Mathematics in Management Science Chinese Postman Problem What is CPP? CPP & ECs & EPs Fleury’s Algorithm Eulerization.

Solving CPP – easy case

If graph has an Euler circuit (or path), it is a minimal length circuit (or path) traversing the entire graph.

Euler’s Circuit/Path Theorems tell us exactly when a graph has EC/EP.

How do we actually find an Euler circuit or Euler path?

Page 8: Spring 2015 Mathematics in Management Science Chinese Postman Problem What is CPP? CPP & ECs & EPs Fleury’s Algorithm Eulerization.

Fleury’s Algorithm

Check that the graph is connected and either has no odd vertices (for circuit), or has two odd vertices (for path).

Choose a starting vertex. For a circuit, can be any vertex; for path, it must be one of the two odd vertices.

At each step, if you have a choice, don’t choose a bridge of the yet-to-be-traveled part of the graph.

Page 9: Spring 2015 Mathematics in Management Science Chinese Postman Problem What is CPP? CPP & ECs & EPs Fleury’s Algorithm Eulerization.

Bridges

An edge is called a bridge if erasing it makes the graph disconnected.

BF, FG, FH are bridges

Page 10: Spring 2015 Mathematics in Management Science Chinese Postman Problem What is CPP? CPP & ECs & EPs Fleury’s Algorithm Eulerization.

Summary – CPP so far

Euler circuits and paths provide the most efficient means to traverse all edges of a graph.

Euler’s Theorems tell us an easy way to determine when a graph has an Euler circuit or path: the graph must be connected & all (all but 2 for path) vertices must be even.

Page 11: Spring 2015 Mathematics in Management Science Chinese Postman Problem What is CPP? CPP & ECs & EPs Fleury’s Algorithm Eulerization.

Solving CPP – harder case

What if there are no ECs or EPs?No EC means: some odd vertex! No EP means: 4 or more odd vtxs.No EC/EP: gotta retrace edge(s).• Eulerize the graph• Find an EC (or EP) on new graph• Transfer back to original graph

(“squeeze”)

Page 12: Spring 2015 Mathematics in Management Science Chinese Postman Problem What is CPP? CPP & ECs & EPs Fleury’s Algorithm Eulerization.

Pix’d graph has no EC; C & G odd valence.

Gonna have to retrace the edge CG.

To Eulerize this graph, duplicate edge CG.

Get a new graph! Careful; this new graph is not the same as the original.

Page 13: Spring 2015 Mathematics in Management Science Chinese Postman Problem What is CPP? CPP & ECs & EPs Fleury’s Algorithm Eulerization.

Pix’d graph has no EC; C & G odd valence.

Gonna have to retrace the edge CG.

To Eulerize this graph, duplicate edge CG.

Get new graph pix’d below where the blue edge is duplicated CG edge.

Page 14: Spring 2015 Mathematics in Management Science Chinese Postman Problem What is CPP? CPP & ECs & EPs Fleury’s Algorithm Eulerization.

Now find EC for this new graph; this easy.

Then, gotta transfer this EC back to original graph; traversing the blue edge here corresponds to retracing the CG edge in original graph.

Page 15: Spring 2015 Mathematics in Management Science Chinese Postman Problem What is CPP? CPP & ECs & EPs Fleury’s Algorithm Eulerization.

The numbered edges describe the circuitA→B→C→D→H→G→C→G→F→B→F→E→A

in the original graph.

This then gives an efficient route for our meter reader.

Page 16: Spring 2015 Mathematics in Management Science Chinese Postman Problem What is CPP? CPP & ECs & EPs Fleury’s Algorithm Eulerization.

Eulerizing Graphs

If all vtxs are even, done (have an EC). Otherwise, have odd vtxs: mark them. (Must have even number of odd vtxs!)

Pick an odd vtx. Duplicate an existing edge having this vtx as an endpoint.

Change valences of two vtxs just connected. All vtxs even – done; otherwise, repeat the above step.

Page 17: Spring 2015 Mathematics in Management Science Chinese Postman Problem What is CPP? CPP & ECs & EPs Fleury’s Algorithm Eulerization.

Example

Page 18: Spring 2015 Mathematics in Management Science Chinese Postman Problem What is CPP? CPP & ECs & EPs Fleury’s Algorithm Eulerization.

Example

Page 19: Spring 2015 Mathematics in Management Science Chinese Postman Problem What is CPP? CPP & ECs & EPs Fleury’s Algorithm Eulerization.

Example

Page 20: Spring 2015 Mathematics in Management Science Chinese Postman Problem What is CPP? CPP & ECs & EPs Fleury’s Algorithm Eulerization.

Example

Page 21: Spring 2015 Mathematics in Management Science Chinese Postman Problem What is CPP? CPP & ECs & EPs Fleury’s Algorithm Eulerization.

Finding Good Eulerizations

Locate odd vertices. Try to duplicate connecting edges between pairs of odd vertices.

Sometimes odd vertices more than one edge apart; if so, gotta duplicate buncha edges.

Look for the fewest edges to duplicate to make all vertices even.

Page 22: Spring 2015 Mathematics in Management Science Chinese Postman Problem What is CPP? CPP & ECs & EPs Fleury’s Algorithm Eulerization.

Rectangular Networks

Page 23: Spring 2015 Mathematics in Management Science Chinese Postman Problem What is CPP? CPP & ECs & EPs Fleury’s Algorithm Eulerization.

“Edge Walker” AlgorithmStart in upper left corner. Travel

(clockwise) around outer boundary.As you travel, duplicate edge via rules:• If vertex is odd, duplicate edge and

link this vertex to next vertex.– If next vertex becomes even, skip it (just

keep “walking”).– If next vertex becomes odd, (on a

corner) link it to the next vertex.• Repeat rules until you reach the

upper left corner again.

Page 24: Spring 2015 Mathematics in Management Science Chinese Postman Problem What is CPP? CPP & ECs & EPs Fleury’s Algorithm Eulerization.
Page 25: Spring 2015 Mathematics in Management Science Chinese Postman Problem What is CPP? CPP & ECs & EPs Fleury’s Algorithm Eulerization.
Page 26: Spring 2015 Mathematics in Management Science Chinese Postman Problem What is CPP? CPP & ECs & EPs Fleury’s Algorithm Eulerization.
Page 27: Spring 2015 Mathematics in Management Science Chinese Postman Problem What is CPP? CPP & ECs & EPs Fleury’s Algorithm Eulerization.
Page 28: Spring 2015 Mathematics in Management Science Chinese Postman Problem What is CPP? CPP & ECs & EPs Fleury’s Algorithm Eulerization.
Page 29: Spring 2015 Mathematics in Management Science Chinese Postman Problem What is CPP? CPP & ECs & EPs Fleury’s Algorithm Eulerization.

Sometimes need an exhaustive route, but no “closed” requirement—route may start & stop at different points.

Now want to leave two odd vertices on the graph unchanged, and change the other odd vertices into even.

Route begins & ends at two odd vtxs.

Semi-Eulerizing Graphs

Page 30: Spring 2015 Mathematics in Management Science Chinese Postman Problem What is CPP? CPP & ECs & EPs Fleury’s Algorithm Eulerization.
Page 31: Spring 2015 Mathematics in Management Science Chinese Postman Problem What is CPP? CPP & ECs & EPs Fleury’s Algorithm Eulerization.

Conclusion

GraphsThe idea goes back to Euler.

Graph ModelsGraph theory useful to solve routing and network problems.

AlgorithmStep-by-step rules.Fleury’s Alg, “Edge Walker” Alg