# Chapter 2: Business Efficiency Lesson Plan Business Efficiency  Visiting Vertices-Graph Theory Problem Hamiltonian Circuits  Vacation Planning Problem.

## Presentation on theme: "Chapter 2: Business Efficiency Lesson Plan Business Efficiency  Visiting Vertices-Graph Theory Problem Hamiltonian Circuits  Vacation Planning Problem."— Presentation transcript:

Chapter 2: Business Efficiency Lesson Plan Business Efficiency  Visiting Vertices-Graph Theory Problem Hamiltonian Circuits  Vacation Planning Problem Minimum Cost-Hamiltonian Circuit Method of Trees  Fundamental Principle of Counting Traveling Salesman Problem Helping Traveling Salesmen  Nearest Neighbor and Sorted Edges Algorithms  Minimum-Cost Spanning Trees Kruskal’s Algorithm Critical-Path Analysis Mathematical Literacy in Today’s World, 8th ed. For All Practical Purposes

Chapter 2: Business Efficiency Business Efficiency Visiting Vertices  In some graph theory problems, it is only necessary to visit specific locations (using the travel routes, or streets available).  Problem: Find an efficient route along distinct edges of a graph that visits each vertex only once in a simple circuit. Applications : Salesman visiting particular cities Delivering mail to drop-off boxes Route taken by a snowplow Pharmaceutical representative visiting doctors

Hamiltonian Circuit AA tour that starts and ends at the same vertex (circuit definition). VVisits each vertex once. (Vertices cannot be reused or revisited.) CCircuits can start at any location. UUse wiggly edges to show the circuit. Chapter 2: Business Efficiency Hamiltonian Circuit

Starting at vertex A, the tour can be written as ABDGIHFECA, or starting at E, it would be EFHIGDBACE. Chapter 2: Business Efficiency Business Efficiency

A different circuit visiting each vertex once and only once would be CDBIGFEHAC (starting at vertex C). Chapter 2: Business Efficiency Business Efficiency

Euler circuit – A circuit that traverses each edge of a graph exactly once and starts and stops at the same point. Chapter 2: Business Efficiency Hamiltonian Circuit vs. Euler Circuits

Hamiltonian circuit – A tour (showed by wiggly edges) that starts at a vertex of a graph and visits each vertex once and only once, returning to where it started.

Hamiltonian vs. Euler Circuits Similarities BBoth forbid re-use. Hamiltonian do not reuse vertices. Euler do not reuse edges.

DDifferences HHamiltonian is a circuit of vertices. EEuler is a circuit of edges. EEuler graphs are easy to spot (connectedness and even valence). HHamiltonian circuits are NOT as easy to determine upon inspection. SSome certain family of graphs can be known to have or not have Hamiltonian circuits.

Chapter 2: Business Efficiency Hamiltonian Circuits Example 1 Vacation Planning Problem

Chapter 2: Business Efficiency Hamiltonian Circuits Let’s imagine that you are a college student in Chicago. During spring break you and a group of friends have decided to take a car trip to visit other friends in Minneapolis, Cleveland, and St. Louis. There are many choices as to the order of visiting cities and returning to Chicago, but you want to design a route that minimizes the distance you have to travel. This will also cut costs because of the cost of gasoline for the trip.

Chapter 2: Business Efficiency Hamiltonian Circuits Similar problems with complications would arise for bus, railroad, or airplane trips. Now the local automobile club has provided you with the inter-city driving distances between Chicago, Minneapolis, Cleveland, and St. Louis. We can construct a graph model with this information, representing each city by a vertex and the legs of the journey between cities by edges joining the vertices. To complete the model, we add a number called a weight to each graph edge.

Chapter 2: Business Efficiency Hamiltonian Circuits  Hamiltonian circuit concept is used to find the best route that minimizes the total distance traveled to visit friends in different cities. (assume less mileage  less gas  minimizes costs)

Hamiltonian circuit with weighted edges EEdges of the graph are given weights, or in this case mileage or distance between cities. AAs you travel from vertex to vertex, add the numbers (mileage in this case). EEach Hamiltonian circuit will produce a particular sum. Chapter 2: Business Efficiency Hamiltonian Circuits

Minimum-Cost Hamiltonian Circuit AA Hamiltonian circuit with the lowest possible sum of the weights of its edges. Chapter 2: Business Efficiency Hamiltonian Circuit Algorithm is a step-by-step description of how to solve a problem.

Algorithm (step-by-step process) for Solving This Problem 1.Generate all possible Hamiltonian tours (starting with Chicago). 2.Add up the distances on the edges of each tour. 3.Choose the tour of minimum distance. Chapter 2: Business Efficiency Hamiltonian Circuit

Steps 2 and 3 of the algorithm are straightforward. Thus, we need worry only about Step 1, generating all the possible Hamiltonian circuits in a systematic way. Chapter 2: Business Efficiency Hamiltonian Circuit To find the Hamiltonian tours, we will use the method of trees. In this step we disregard the distances.

1 st Stage Chapter 2: Business Efficiency Hamiltonian Circuit This stage is where you select a starting vertex, say Chicago, and making a tree-diagram showing the next possible locations.

Chapter 2: Business Efficiency Hamiltonian Circuit

2nd Stage Chapter 2: Business Efficiency Hamiltonian Circuit At each subsequent stage down, there will be one less choice.

Chapter 2: Business Efficiency Hamiltonian Circuit 22

3rd Stage Chapter 2: Business Efficiency Hamiltonian Circuit At each subsequent stage down, there will be one less choice.

Chapter 2: Business Efficiency Hamiltonian Circuits

Notice that 1 and 6 are the same tour, 2 and 4 are the same tour, and 3 and 5 are the same tour. So there are only three are unique circuits. Find the total distance for each unique circuit. Name the 6 tours from the tree. Chapter 2: Business Efficiency Hamiltonian Circuits 1.C-M-S-CL-C 2.C-M-CL-S-C 3.C-S-M-CL-C 4.C-S-CL-M-C 5.C-CL-M-S-C 6.C-CL-S-M-C

Chapter 2: Business Efficiency Hamiltonian Circuits The three Hamiltonian circuits’ sums of the tours The optimal tour is Chicago, Minneapolis, St. Louis, Cleveland, Chicago. These graphs are called complete graphs.

CHAPTER 2: BUSINESS EFFICIENCY HAMILTONIAN CIRCUITS 2 nd Day

Complete graph – A graph in which every pair of vertices is joined by an edge. Chapter 2: Business Efficiency Hamiltonian Circuits

Suppose instead of going to 4 cities you had to plan a minimum cost circuit for 100 cities. Making a tree would take an incredible amount of time. There is a better way. Chapter 2: Business Efficiency Hamiltonian Circuits

Fundamental Principle of Counting If there are “a” ways of choosing one thing, “b” ways of choosing a second after the first is chosen, “c” ways of choosing a third after the second is chosen…, and so on…, and “z” ways of choosing the last item after the earlier choices, then the total number of choice patterns is a × b × c × … × z. Example: Jack has 9 shirts and 4 pairs of pants. He can wear 9 × 4 = 36 shirt-pant outfits.

1.In a restaurant there are 4 kinds of soup, 12 entrees, 6 desserts, and 3 drinks. How many different four-course meals can a patron choose? 4 x 12 x 6 x 3 = 864 possible meals Chapter 2: Business Efficiency Hamiltonian Circuits

2.In a state lottery a contestant gets to pick a four-digit number that does not contain a zero followed by an uppercase or lowercase letter. How many such sequences of digits and a letter are there? Each of the four digits can be chosen 9 ways (that is, 1, 2, …, 9), and the letter can be chosen in 52 ways (that is, A, B, …, Z plus a, b, …, z). So 9 x 9 x 9 x 9 x 52 = 341, 172 Chapter 2: Business Efficiency Hamiltonian Circuits

3.A corporation is planning a musical logo consisting of four different ordered notes from the scale C, D, E, F, G, A, and B. a.How many logos are there to choose from if no letter can be reused? The 1 st note can be chosen in 7 ways, but because reuse is not allowed, the next note can be chosen in only 6 ways. The remaining two notes can be chosen in 5 and 4 ways, respectively. So 7 x 6 x 5 x 4 = 840 musical logos Chapter 2: Business Efficiency Hamiltonian Circuits

b.How many logos are there to choose from if letters can be reused? 7 x 7 x 7 x 7 = 2401 musical logos Chapter 2: Business Efficiency Hamiltonian Circuits

Let’s use the Fundamental Counting Principal on the spring break trip. Stage 1 = 3 cities Stage 2 = 2 cities Stage 3 = 1 city

Notice that 1 and 6 are the same tour, 2 and 4 are the same tour, and 3 and 5 are the same tour. So there are only three are unique circuits. So 3 x 2 x 1 = 6 tours Chapter 2: Business Efficiency Hamiltonian Circuits 1.C-M-S-CL-C 2.C-M-CL-S-C 3.C-S-M-CL-C 4.C-S-CL-M-C 5.C-CL-M-S-C 6.C-CL-S-M-C

Chapter 2: Business Efficiency Hamiltonian Circuit Principle of Counting for Hamiltonian Circuits FFor a complete graph of n vertices, there are (n - 1)! possible routes. HHalf of these routes are repeats, the result is: Possible unique Hamiltonian circuits are (n - 1)! / 2

Chapter 2: Business Efficiency Hamiltonian Circuits Road mileage between four cities There are 4 vertices. So there are (4 – 1)! possibilities. 3! = (3)(2)(1) = 6 3!/2 = 6/2 = 3 circuits

Chapter 2: Business Efficiency Hamiltonian Circuit Examples: 1.How many different tours could there be with six cities? (6 – 1)!/2 = 5!/2 = 60 different tours 2.How many different tours could there be with ten cities. (10 – 1)!/2 = 9!/2 = 181,440 different tours

Chapter 2: Business Efficiency Hamiltonian Circuit This method is good for small circuits but as you saw the number of different tours can rather large very quickly. That is why this method is called a brute force method.