Chapter 2: Business Efficiency Lesson Plan

Slides:



Advertisements
Similar presentations
Chapter 2: Business Efficiency Lesson Plan
Advertisements

Introduction to Graph Theory Instructor: Dr. Chaudhary Department of Computer Science Millersville University Reading Assignment Chapter 1.
Chapter 2: Business Efficiency Lesson Plan Business Efficiency  Visiting Vertices-Graph Theory Problem Hamiltonian Circuits  Vacation Planning Problem.
Chapter 7 Graph Theory 7.1 Modeling with graphs and finding Euler circuits. Learning Objectives: Know how to use graphs as models and how to determine.
Chapter 15 Graph Theory © 2008 Pearson Addison-Wesley. All rights reserved.
1 Chapter 15.3 Hamilton Paths and Hamilton Circuits Objectives 1.Understand the definitions of Hamilton paths & Hamilton circuits. 2.Find the number of.
Chapter 4 sec. 2.  A famous and difficult problem to solve in graph theory.
Algorithm Strategies Nelson Padua-Perez Chau-Wen Tseng Department of Computer Science University of Maryland, College Park.
A traveling salesman has customers in 5 cities which we will call A, B, C, D, and E. The salesman needs to travel to all 5 cities with his trip starting.
Two Discrete Optimization Problems Problem #2: The Minimum Cost Spanning Tree Problem.
Approximation Algorithms Motivation and Definitions TSP Vertex Cover Scheduling.
Backtracking.
Chapter 2: Business Efficiency Lesson Plan Business Efficiency  Visiting Vertices-Graph Theory Problem Hamiltonian Circuits  Vacation Planning Problem.
Chapter 15 Graph Theory © 2008 Pearson Addison-Wesley.
Minimum Spanning Trees What is a MST (Minimum Spanning Tree) and how to find it with Prim’s algorithm and Kruskal’s algorithm.
Lecture 23. Greedy Algorithms
Theory of Computing Lecture 10 MAS 714 Hartmut Klauck.
Slide 14-1 Copyright © 2005 Pearson Education, Inc. SEVENTH EDITION and EXPANDED SEVENTH EDITION.
Chapter 12 Coping with the Limitations of Algorithm Power Copyright © 2007 Pearson Addison-Wesley. All rights reserved.
SPANNING TREES Lecture 21 CS2110 – Spring
Excursions in Modern Mathematics, 7e: Copyright © 2010 Pearson Education, Inc. 6 The Mathematics of Touring 6.1Hamilton Paths and Hamilton Circuits.
Graph Theory Topics to be covered:
Graph Theory Hamilton Paths and Hamilton Circuits.
Spanning Trees Introduction to Spanning Trees AQR MRS. BANKS Original Source: Prof. Roger Crawfis from Ohio State University.
Spring 2015 Mathematics in Management Science Network Problems Networks & Trees Minimum Networks Spanning Trees Minimum Spanning Trees.
© 2015 JW Ryder CSCI 203 Data Structures1. © 2015 JW Ryder CSCI 203 Data Structures2.
1 Excursions in Modern Mathematics Sixth Edition Peter Tannenbaum.
© 2010 Pearson Prentice Hall. All rights reserved. 1 §15.3, Hamilton Paths and Circuits.
Spring 2015 Mathematics in Management Science Traveling Salesman Problem Approximate solutions for TSP NNA, RNN, SEA Greedy Heuristic Algorithms.
Chapter 2: Business Efficiency Lesson Plan
Copyright 2013, 2010, 2007, Pearson, Education, Inc. Section 14.3 Hamilton Paths, and Hamilton Circuits.
Chapter 2: Business Efficiency Lesson Plan Business Efficiency  Visiting Vertices-Graph Theory Problem Hamiltonian Circuits  Vacation Planning Problem.
Chapter 14 Section 4 - Slide 1 Copyright © 2009 Pearson Education, Inc. AND.
EXCURSIONS IN MODERN MATHEMATICS SIXTH EDITION Peter Tannenbaum 1.
Graphs A ‘Graph’ is a diagram that shows how things are connected together. It makes no attempt to draw actual paths or routes and scale is generally inconsequential.
Spring 2015 Mathematics in Management Science Network Problems Networks & Trees Minimum Networks Spanning Trees Minimum Spanning Trees.
Chapter 1: Urban Services Lesson Plan
Mathematics in Management Science
CIRCUITS, PATHS, AND SCHEDULES Euler and Königsberg.
Graph Theory Hamilton Paths Hamilton Circuits and.
SPANNING TREES Lecture 20 CS2110 – Fall Spanning Trees  Definitions  Minimum spanning trees  3 greedy algorithms (incl. Kruskal’s & Prim’s)
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley. Ver Chapter 13: Graphs Data Abstraction & Problem Solving with C++
AND.
© 2006 Pearson Addison-Wesley. All rights reserved 14 A-1 Chapter 14 Graphs.
SPANNING TREES Lecture 21 CS2110 – Fall Nate Foster is out of town. NO 3-4pm office hours today!
Graph Theory Trees. WHAT YOU WILL LEARN Trees, spanning trees, and minimum-cost spanning trees.
I can describe the differences between Hamilton and Euler circuits and find efficient Hamilton circuits in graphs. Hamilton Circuits I can compare and.
Chapter 14 Section 3 - Slide 1 Copyright © 2009 Pearson Education, Inc. AND.
Unit 2 Hamiltonian Circuits. Hamiltonian Circuit: A tour that starts at a vertex of a graph and visits each vertex once and only once, returning to where.
Grade 11 AP Mathematics Graph Theory Definition: A graph, G, is a set of vertices v(G) = {v 1, v 2, v 3, …, v n } and edges e(G) = {v i v j where 1 ≤ i,
Mathematical modeling To describe or represent a real-world situation quantitatively, in mathematical language.
Chapter 2: Business Efficiency Hamiltonian Circuit Visiting Vertices –In some graph theory problems, it is only necessary to visit specific locations (using.
MAT 110 Workshop Created by Michael Brown, Haden McDonald & Myra Bentley for use by the Center for Academic Support.
Hamilton Paths and Hamilton Circuits
Excursions in Modern Mathematics Sixth Edition
Redraw these graphs so that none of the line intersect except at the vertices B C D E F G H.
Chapter 2: Business Efficiency Lesson Plan
Chapter 2: Business Efficiency Lesson Plan
Section 14.3 Hamilton Paths, and Hamilton Circuits
* Hamiltonian Circuits introduction
Graphs Chapter 13.
Autumn 2015 Lecture 11 Minimum Spanning Trees (Part II)
Graphs Chapter 11 Objectives Upon completion you will be able to:
Chapter 2: Business Efficiency Business Efficiency
4-4 Graph Theory Trees.
Chapter 1: Urban Services Lesson Plan
Hamilton Paths and Hamilton Circuits
Chapter 1: Urban Services Management Science
Spanning Trees Lecture 20 CS2110 – Spring 2015.
Chapter 1: Urban Services Lesson Plan
Presentation transcript:

Chapter 2: Business Efficiency Lesson Plan 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 Salesman Nearest Neighbor and Sorted Edges Algorithms Minimum-Cost Spanning Trees Kruskal’s Algorithm Prim’s Algorithm

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 Inspecting traffic signals Delivering mail to drop-off boxes Pharmaceutical representative visiting doctors

Chapter 2: Business Efficiency Vocabulary Review

Remember….Chapter 1: Urban Services Finding Euler Circuits Is there an Euler Circuit? Does it have even valence? (Yes) Is the graph connected? (Yes) Euler circuit exists if both “yes.” Create (Find) an Euler Circuit Pick a point to start (if none has been given to you). Number the edges in order of travel, showing the direction with arrows. Cover every edge only once, and end at the same vertex where you started.

Chapter 2: Business Efficiency Hamiltonian Circuit A tour that starts and ends at the same vertex (circuit definition). Visits each vertex once. (Vertices cannot be reused or revisited.) Circuits can start at any location. Use wiggly edges to show the circuit. Starting at vertex A, the tour can be written as ABDGIHFECA, or starting at E, it would be EFHIGDBACE. A different circuit visiting each vertex once and only once would be CDBIGFEHAC (starting at vertex C).

Chapter 2: Business Efficiency Hamiltonian Circuit vs. Euler Circuits Hamiltonian vs. Euler Circuits Similarities Both forbid re-use. Hamiltonian do not reuse vertices. Euler do not reuse edges. Differences Hamiltonian is a circuit of vertices. Euler is a circuit of edges. Euler graphs are easy to spot (connectedness and even valence). Hamiltonian circuits are NOT as easy to determine upon inspection. (some classes of graphs have them, so do not) 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. 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 Graphs that will NEVER have a Hamiltonian Circuit A family of graphs that never has a Hamiltonian circuit Constructed with vertices on two parallel vertical columns with one column having more vertices than the other.

Task: Find a Hamiltonian circuit for this graph starting at vertex A

Solution: One solution…others???

Task: Does this graph have a Hamiltonian circuit?

Solution: No...cannot avoid visiting vertices C and D more than one time to reach all vertices

Chapter 2: Business Efficiency Hamiltonian Circuits Vacation–Planning Problem 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 Edges of the graph are given weights, or in this case mileage or distance between cities. As you travel from vertex to vertex, add the numbers (mileage in this case). Each Hamiltonian circuit will produce a particular sum. Road mileage between four cities

Chapter 2: Business Efficiency Hamiltonian Circuit Minimum-Cost Hamiltonian Circuit A Hamiltonian circuit with the lowest possible sum of the weights of its edges. Algorithm (step-by-step process) for Solving This Problem Generate all possible Hamiltonian tours (starting with Chicago). Add up the distances on the edges of each tour. Choose the tour of minimum distance. Algorithm – A step-by-step description of how to solve a problem.

Chapter 2: Business Efficiency Hamiltonian Circuits Method of Trees For the first step of the algorithm, disregard distances Begin by selecting a starting vertex, say Chicago, and making a tree-diagram showing the next possible locations. At each stage down, there will be one less choice (3, 2,then 1 choice). In this example, the method of trees generated six different paths, all starting and ending with Chicago. *However, only three are unique circuits….why? Method of trees for vacation-planning problem

Chapter 2: Business Efficiency Hamiltonian Circuits Minimum-Cost Hamiltonian Circuit: Vacation-Planning Example Method of tree used to find all tours (for four cities: three unique paths). On the graph, the unique paths are drawn with wiggly lines. Add up distance on edges of each unique tour. The smallest sum would give us the minimal distance, which is the minimum cost. Choose the tour of minimum distance. The smallest sum would give us the minimal distance, which is the minimum cost. The three Hamiltonian circuits’ sums of the tours

Task: Use the method of trees to find all possible Hamiltonian circuits for this graph starting at A.

Solution: Next three are reversals First three branches yield three distinct Hamiltonian circuits ABCDA ABDCA Next three are reversals ADCBA ACDBA ADBCA

Chapter 2: Business Efficiency Hamiltonian Circuit Principle of Counting for Hamiltonian Circuits For a complete graph of n vertices, there are (n - 1)! possible routes. Half of these routes are repeats, the result is: Possible unique Hamiltonian circuits are (n - 1)! / 2 Complete graph – A graph in which every pair of vertices is joined by an edge.

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

Task: Determine how many Hamiltonian circuits there are for a complete graph with 10 vertices.

Solution:  

Chapter 2: Business Efficiency Traveling Salesman Problem Traveling Salesman Problem (TSP) Difficult to solve Hamiltonian circuits when the number of vertices in a complete graph increases (n becomes very large). This problem originated from a salesman determining his trip that minimizes costs (less mileage) as he visits the cities in a sales territory, starting and ending the trip in the same city.

Chapter 2: Business Efficiency Traveling Salesman Problem Traveling Salesman Problem (TSP) Many applications today: Lobster Fisherman needs to pick up nets Bus picking up campers and then returning them Picking up records from ATM machines Driving service dropping people from the airport You running your errands…thank you Jared Macke!

Chapter 2: Business Efficiency Hamiltonian Circuit 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. This means that…if Jack has 3 pairs of pants, 4 shirts and 4 hats, then he has 3 x 4 x 4 = 48 outfits!

Task: To encourage her son to try new things, a mother offers to take him for a dish of ice cream with a topping once a week, for as many weeks he does not get the same choice as on a previous occasion. If the store offers 12 flavors and six toppings, how many weeks will she have to do this if her son never picks either of the two types of chocolate ice cream or the three types of nut topping?

Solution: (12-2) x (6-3) = 10 x 3 = 30 weeks

Task: A large corporation has found that it has “outgrown” its current code system for routing interoffice mail. Current system places a code of three ordered, distinct nonzero digits on the mail New system calls for the use of two ordered capital letters Is it an improvement?

Task: Current system 9 x 8 x 7 = 504 New system calls for the use of two ordered capital letters 26 x 26 = 676 Is it an improvement? Yes! 676 – 504 = 172 more codes

Chapter 2: Business Efficiency Traveling Salesman Problem  

Chapter 2: Business Efficiency Traveling Salesman Problem How can the TSP be solved? Computer program can find optimal route (not always practical). Heuristic methods can be used to find a “fast” answer, but does not guarantee that it is always the optimal answer. Nearest-Neighbor algorithm Sorted-Edges algorithm Review… What is an algorithm? What is our goal?

Nearest-Neighbor Algorithm Chapter 2: Business Efficiency Traveling Salesman Problem: Nearest-Neighbor Algorithm Nearest-Neighbor Algorithm Starting from the home city, first visit the nearest city, then visit the nearest city that has not already been visited. We return to the start city when no other choice is available.

Chapter 2: Business Efficiency Demonstrate the Nearest-Neighbor Algorithm *Start in Seattle*

Chapter 2: Business Efficiency Nearest-Neighbor Algorithm Chapter 2: Business Efficiency Nearest-Neighbor Algorithm *Start at vertex A*

Sorted Edges Algorithm Chapter 2: Business Efficiency Traveling Salesman Problem: Sorted Edges Algorithm Sorted Edges Algorithm Start by sorting or arranging the edges of the complete graph in order of increasing cost or distance. Then at each stage we can select that edge of least cost that (1) never requires that three used edges meet at a vertex and that (2) never closes up a circular tour that doesn’t include all the vertices.

Chapter 2: Business Efficiency Demonstrate the Sorted Edges Algorithm Chapter 2: Business Efficiency Demonstrate the Sorted Edges Algorithm *Start???*

Chapter 2: Business Efficiency Sorted Edges Algorithm

Chapter 2: Business Efficiency Minimum-Cost Spanning Trees What is the cost to construct underground power cables to service among five cities? The diagram shows the cost to build the connection from each vertex to all other vertices (connected graph). Cities are linked in order of increasing costs to make the connection. The cost of redirecting the service may be small compared to adding another link. Costs (in millions of dollars) of installing service among five cities

Chapter 2: Business Efficiency Minimum-Cost Spanning Trees A tree consists of one piece contains no circuits. A spanning tree a tree that connects all vertices of a graph with each other no redundancy.

Task: With A as the original graph, which of the graphs shown in bold represent trees and/or spanning trees?

Chapter 2: Business Efficiency Minimum-Cost Spanning Trees graph theory optimization problem that links all the vertices together, in order of increasing costs, to form a “tree.” The cost of the tree is the sum of the weights on the edges.

Chapter 2: Business Efficiency Spanning Trees Two spanning trees for graph A are shown in B and C.

Chapter 2: Business Efficiency Minimum-Cost Spanning Trees Kruskal’s Algorithm — Developed by Joseph Kruskal (AT&T research). Goal: Create a tree that links all the vertices together and achieves the lowest cost to create. Add links in order of cheapest cost according to the rules: No circuit is created (no loops). If a circuit (or loop) is created by adding the next largest link, eliminate this largest (most expensive link)—it is not needed. Every vertex must be included in the final tree.

Chapter 2: Business Efficiency Minimum-Cost Spanning Trees Greedy Algorithms Extend a tree by including the cheapest outgoing edge Add the cheapest edge that joins disjoint components Delete the most expensive edge that does not disconnect the graph

Task: Using this graph, find the MSP by applying Prim’s Algorithm beginning at vertex A Extend a tree by including the cheapest outgoing edge

Task: Using this graph, find the MSP by applying Kruskal’s Algorithm Add the cheapest edge that joins disconnected components

Task: Using this graph, find the MSP by applying the Reverse-Delete Algorithm. Delete the most expensive edge that does not disconnect the graph

Task: Using this graph, apply Kruskal’s Algorithm

Chapter 2: Business Efficiency Critical Path Analysis Most often, scheduling jobs consists of complicated tasks that cannot be done in a random order. Due to a pre-defined order of tasks, the entire job may not be done any sooner than the longest path of dependent tasks.

Chapter 2: Business Efficiency Critical Path Analysis Order-Requirement Digraph A directed graph (digraph) that shows which tasks precede other tasks among the collection of tasks making up a job.

Chapter 2: Business Efficiency Order Requirement Graph True or False T1 must be done before T2 T2 must be done before T4 T1 must be done before T7 T2 need not be done before T5 T3 need not be done before T5

Chapter 2: Business Efficiency Critical Path Analysis The longest path in an order-requirement digraph. The length is measured in terms of summing the task times of the tasks making up the path. An order-requirement digraph, tasks A – E with task times in the circles Critical Path is BE = 25 + 27 = 52 min.

Chapter 2: Business Efficiency Find the Critical Path for this order-requirement digraph

Chapter 2: Business Efficiency What is the length of the earliest completion time for this order-requirement digraph?