SlideShare a Scribd company logo
1 of 24
Chapter 1. Skill Objectives


 1. Determine by observation if a graph is connected.
 2. Identify vertices and edges of a given graph.
 3. Construct the graph of a given street network.
 4. Determine by observation the valence of each vertex of
  a graph.
 5. Define an Euler circuit.
 6. List the two conditions for the existence of an Euler
  circuit.
 7. Determine whether a graph contains an Euler circuit.
Chapter 1. Skill Objectives (cont’d)


 8. If a graph contains an Euler circuit, list one such circuit
  by identifying the order in which the vertices are used by
  the circuit, or by identifying the order in which the edges
  are to be used.
 9. If a graph does not contain an Euler circuit, add a
  minimum number of edges to ―eulerize‖ the graph.
 11. Identify management science problems whose
  solutions involve Euler circuits.
Chapter 2: Business Efficiency
• Given a collection of cities as
The       well as the cost of travel
          between each, we must find
Probl     the cheapest way of visiting all
          the cities and returning to the
em        starting point
        • Studying the TSP has led to
          improved solutions in other
          math areas
        • One of the most intensely
          studied problems
        • No effective solution is known
          – $1,000,000 prize from the Clay
            Mathematics Institute
Arranging school bus
 routes                      Applicat
Delivery of meals to        ions
 homebound persons
Scheduling of a
 machine to drill holes in
 a circuit board
Genome sequencing
Scan chain optimization
 in computer chips
Trip planning
For All Practical
Chapter 2: Business Efficiency                              Purposes




          Business Efficiency
             Visiting Vertices-Graph Theory Problem
                                                        Mathematical Literacy in
                                                         Today’s World, 8th ed.
          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
© 2009, W.H. Freeman and Company
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
Chapter 2: Business Efficiency
Hamiltonian Circuit
 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    A different circuit visiting each vertex
written as ABDGIHFECA, or starting at    once and only once would be
E, it would be EFHIGDBACE.               CDBIGFEHAC (starting at vertex C).
Chapter 2: Business Efficiency
Hamiltonian Circuit vs. Euler Circuits
Hamiltonian vs. Euler Circuits               Hamiltonian circuit –
 Similarities                                 A tour (showed by
   Both forbid re-use.                        wiggly edges) that
      Hamiltonian do not reuse vertices.      starts at a vertex of a
      Euler do not reuse edges.               graph and visits each
                                               vertex once and only
 Differences                                  once, returning to
   Hamiltonian is a circuit of vertices.      where it started.
   Euler is a circuit of edges.
   Euler graphs are easy to spot             Euler circuit – A circuit
    (connectedness and even valence).           that traverses each
   Hamiltonian circuits are NOT as easy        edge of a graph
    to determine upon inspection.               exactly once and starts
     Some certain family of graphs can be      and stops at the same
        known to have or not have Hamiltonian
        circuits.                               point.
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
  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          Algorithm – A step-by-step description
     minimum distance.              of how to solve a problem.
Chapter 2: Business Efficiency
Hamiltonian Circuits
 Method of Trees
   For the first step of the algorithm, a systematic approach is
    needed to generate all possible Hamiltonian tours (disregard
    distances during this step).
   This method begins 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.             Method of trees for vacation-planning problem
Chapter 2: Business Efficiency
Hamiltonian Circuits
 Minimum-Cost Hamiltonian
  Circuit: Vacation-Planning
  Example
 1. 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.
 2. Add up distance on edges
    of each unique tour. The
    smallest sum would give us
    the minimal distance, which
    is the minimum cost.
 3. 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
Chapter 2: Business Efficiency
Hamiltonian Circuit
 Principle of Counting
                                                                 Complete graph –
      for Hamiltonian Circuits
    For a complete graph of n vertices, there are
                                                                   A graph in
     (n - 1)! possible routes.                                     which every
    Half of these routes are repeats, the result is:              pair of vertices
   Possible unique Hamiltonian circuits are                        is joined by an
                                                                   edge.
                 (n - 1)! / 2

 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.
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.
   Many applications today: bus schedules, mail drop-
    offs, telephone booth coin pick-up routes, etc.

 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
Chapter 2: Business Efficiency
 Traveling Salesman Problem — Nearest Neighbor
  Nearest Neighbor Algorithm (to solve TSP)
      Starting from the ―home‖ city (or vertex), first visit the nearest city
       (one with the least mileage from ―home‖).
      As you travel from city to city, always choose the next city (vertex)
       that can be reached quickest (i.e., nearest with the least miles),
       that has not already been visited.
      When all other vertices have been visited, the tour returns home.




Hamiltonian Circuit:                       Hamiltonian Circuit:
    A-B-C-E-D-A                                B-C-A-D-E-B
   Nearest neighbor starting at vertex A            Nearest neighbor starting at vertex B
Chapter 2: Business Efficiency
Traveling Salesman Problem — Sorted Edges
 Sorted Edges Algorithm (to solve TSP)
    Start by sorting, or arranging, the edges in order of increasing
     cost (sort smallest to largest mileage between cities).
    At each stage, select that edge of least cost until all the edges
     are connected at the end while following these rules:
       If an edge is added that results in three edges meeting at a
        vertex, eliminate the longest edge.
       Always include all vertices in the
        finished circuit.

Example using sorted edges
Edges selected are DE at 400, BC at
500, AD at 550, and AB at 600 (AC
and AE are not chosen because they
result in three edges meeting at A).
Lastly, CE at 750 is chosen to
complete the circuit of 2800 miles.
Chapter 2: Business Efficiency
Minimum-Cost Spanning Trees
 Minimum-Cost Spanning Trees
   Another 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.

Example: What is the cost to construct a
  Pictaphone service (telephone service
  with video image of the callers) 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.                          Costs (in millions of dollars)
 The cost of redirecting the signal may be        of installing Pictaphone
  small compared to adding another link.           service among five cities
Chapter 2: Business Efficiency
Minimum-Cost Spanning Trees
 Kruskal’s Algorithm — Developed by Joseph Kruskal
  (AT&T research).
   Goal of minimum-cost spanning tree: 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
Critical Path Analysis
 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.
 Order-Requirement Digraph
    A directed graph (digraph) that shows which tasks precede other
     tasks among the collection of tasks making up a job.
 Critical Path
    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.
Order-requirement digraph
Skill Objectives



Skill Objectives (cont’d)


 7. Explain the term heuristic algorithm and list both an
  advantage and a disadvantage.
 8. Discuss the difficulties inherent in the application of the
  brute force method for finding the minimum-cost
  Hamiltonian circuit.
 9. Describe the steps in the nearest-neighbor algorithm.
 10. Find an approximate solution to the traveling salesman
  problem by applying the nearest-neighbor algorithm.
 11. Describe the steps in the sorted-edges algorithm.
 12. Find an approximate solution to the traveling salesman
  problem by applying the sorted-edges algorithm.
.
Skill Objectives (cont’d)


 13. Give the definition of a tree.
 14. Given a graph with edge weights, determine a
  minimum-cost spanning tree.
 15. Identify the critical path in an order-requirement
  digraph.
 16. Find the earliest possible completion time for a
  collection of tasks by finding the critical path in an
  order-requirement digraph.
 17. Explain the difference between a graph and a
  directed graph.

More Related Content

Similar to Na ch02

Similar to Na ch02 (20)

Approximation Algorithms TSP
Approximation Algorithms   TSPApproximation Algorithms   TSP
Approximation Algorithms TSP
 
Prim's and Kruskal's Algorithm
Prim's and Kruskal's AlgorithmPrim's and Kruskal's Algorithm
Prim's and Kruskal's Algorithm
 
A feasible solution algorithm for a primitive vehicle routing problem
A feasible solution algorithm for a primitive vehicle routing problemA feasible solution algorithm for a primitive vehicle routing problem
A feasible solution algorithm for a primitive vehicle routing problem
 
Graphs: Hamiltonian Path and Circuit
 Graphs: Hamiltonian Path and Circuit Graphs: Hamiltonian Path and Circuit
Graphs: Hamiltonian Path and Circuit
 
Maths Presentation.pptx
Maths Presentation.pptxMaths Presentation.pptx
Maths Presentation.pptx
 
Maths Presentation.pptx
Maths Presentation.pptxMaths Presentation.pptx
Maths Presentation.pptx
 
Helgaun's algorithm for the TSP
Helgaun's algorithm for the TSPHelgaun's algorithm for the TSP
Helgaun's algorithm for the TSP
 
MDM-Chapter-9-Updated latest.pptx
MDM-Chapter-9-Updated latest.pptxMDM-Chapter-9-Updated latest.pptx
MDM-Chapter-9-Updated latest.pptx
 
Hamilton circuits7 19and22
Hamilton circuits7 19and22Hamilton circuits7 19and22
Hamilton circuits7 19and22
 
06_AJMS_334_21.pdf
06_AJMS_334_21.pdf06_AJMS_334_21.pdf
06_AJMS_334_21.pdf
 
1
11
1
 
Greedy Algorihm
Greedy AlgorihmGreedy Algorihm
Greedy Algorihm
 
The Floyd–Warshall algorithm
The Floyd–Warshall algorithmThe Floyd–Warshall algorithm
The Floyd–Warshall algorithm
 
1 sollins algorithm
1 sollins algorithm1 sollins algorithm
1 sollins algorithm
 
K046036367
K046036367K046036367
K046036367
 
Algorithm chapter 11
Algorithm chapter 11Algorithm chapter 11
Algorithm chapter 11
 
Data Analysis and Algorithms Lecture 1: Introduction
 Data Analysis and Algorithms Lecture 1: Introduction Data Analysis and Algorithms Lecture 1: Introduction
Data Analysis and Algorithms Lecture 1: Introduction
 
Optimal City Routes (Postman Problem
Optimal City Routes (Postman ProblemOptimal City Routes (Postman Problem
Optimal City Routes (Postman Problem
 
OR 14 15-unit_2
OR 14 15-unit_2OR 14 15-unit_2
OR 14 15-unit_2
 
Traveling salesman problem
Traveling salesman problemTraveling salesman problem
Traveling salesman problem
 

Recently uploaded

Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfSeasiaInfotech2
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 

Recently uploaded (20)

Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdf
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 

Na ch02

  • 1. Chapter 1. Skill Objectives  1. Determine by observation if a graph is connected.  2. Identify vertices and edges of a given graph.  3. Construct the graph of a given street network.  4. Determine by observation the valence of each vertex of a graph.  5. Define an Euler circuit.  6. List the two conditions for the existence of an Euler circuit.  7. Determine whether a graph contains an Euler circuit.
  • 2. Chapter 1. Skill Objectives (cont’d)  8. If a graph contains an Euler circuit, list one such circuit by identifying the order in which the vertices are used by the circuit, or by identifying the order in which the edges are to be used.  9. If a graph does not contain an Euler circuit, add a minimum number of edges to ―eulerize‖ the graph.  11. Identify management science problems whose solutions involve Euler circuits.
  • 3. Chapter 2: Business Efficiency
  • 4. • Given a collection of cities as The well as the cost of travel between each, we must find Probl the cheapest way of visiting all the cities and returning to the em starting point • Studying the TSP has led to improved solutions in other math areas • One of the most intensely studied problems • No effective solution is known – $1,000,000 prize from the Clay Mathematics Institute
  • 5. Arranging school bus routes Applicat Delivery of meals to ions homebound persons Scheduling of a machine to drill holes in a circuit board Genome sequencing Scan chain optimization in computer chips Trip planning
  • 6. For All Practical Chapter 2: Business Efficiency Purposes  Business Efficiency  Visiting Vertices-Graph Theory Problem Mathematical Literacy in Today’s World, 8th ed.  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 © 2009, W.H. Freeman and Company
  • 7. 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
  • 8. Chapter 2: Business Efficiency Hamiltonian Circuit  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 A different circuit visiting each vertex written as ABDGIHFECA, or starting at once and only once would be E, it would be EFHIGDBACE. CDBIGFEHAC (starting at vertex C).
  • 9. Chapter 2: Business Efficiency Hamiltonian Circuit vs. Euler Circuits Hamiltonian vs. Euler Circuits Hamiltonian circuit –  Similarities A tour (showed by  Both forbid re-use. wiggly edges) that  Hamiltonian do not reuse vertices. starts at a vertex of a  Euler do not reuse edges. graph and visits each vertex once and only  Differences once, returning to  Hamiltonian is a circuit of vertices. where it started.  Euler is a circuit of edges.  Euler graphs are easy to spot Euler circuit – A circuit (connectedness and even valence). that traverses each  Hamiltonian circuits are NOT as easy edge of a graph to determine upon inspection. exactly once and starts  Some certain family of graphs can be and stops at the same known to have or not have Hamiltonian circuits. point.
  • 10. 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
  • 11. 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 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 Algorithm – A step-by-step description minimum distance. of how to solve a problem.
  • 12. Chapter 2: Business Efficiency Hamiltonian Circuits  Method of Trees  For the first step of the algorithm, a systematic approach is needed to generate all possible Hamiltonian tours (disregard distances during this step).  This method begins 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. Method of trees for vacation-planning problem
  • 13. Chapter 2: Business Efficiency Hamiltonian Circuits  Minimum-Cost Hamiltonian Circuit: Vacation-Planning Example 1. 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. 2. Add up distance on edges of each unique tour. The smallest sum would give us the minimal distance, which is the minimum cost. 3. 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
  • 14. Chapter 2: Business Efficiency Hamiltonian Circuit  Principle of Counting Complete graph – for Hamiltonian Circuits  For a complete graph of n vertices, there are A graph in (n - 1)! possible routes. which every  Half of these routes are repeats, the result is: pair of vertices Possible unique Hamiltonian circuits are is joined by an edge. (n - 1)! / 2  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.
  • 15. 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.  Many applications today: bus schedules, mail drop- offs, telephone booth coin pick-up routes, etc.  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
  • 16. Chapter 2: Business Efficiency Traveling Salesman Problem — Nearest Neighbor  Nearest Neighbor Algorithm (to solve TSP)  Starting from the ―home‖ city (or vertex), first visit the nearest city (one with the least mileage from ―home‖).  As you travel from city to city, always choose the next city (vertex) that can be reached quickest (i.e., nearest with the least miles), that has not already been visited.  When all other vertices have been visited, the tour returns home. Hamiltonian Circuit: Hamiltonian Circuit: A-B-C-E-D-A B-C-A-D-E-B Nearest neighbor starting at vertex A Nearest neighbor starting at vertex B
  • 17. Chapter 2: Business Efficiency Traveling Salesman Problem — Sorted Edges  Sorted Edges Algorithm (to solve TSP)  Start by sorting, or arranging, the edges in order of increasing cost (sort smallest to largest mileage between cities).  At each stage, select that edge of least cost until all the edges are connected at the end while following these rules:  If an edge is added that results in three edges meeting at a vertex, eliminate the longest edge.  Always include all vertices in the finished circuit. Example using sorted edges Edges selected are DE at 400, BC at 500, AD at 550, and AB at 600 (AC and AE are not chosen because they result in three edges meeting at A). Lastly, CE at 750 is chosen to complete the circuit of 2800 miles.
  • 18. Chapter 2: Business Efficiency Minimum-Cost Spanning Trees  Minimum-Cost Spanning Trees  Another 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. Example: What is the cost to construct a Pictaphone service (telephone service with video image of the callers) 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. Costs (in millions of dollars)  The cost of redirecting the signal may be of installing Pictaphone small compared to adding another link. service among five cities
  • 19. Chapter 2: Business Efficiency Minimum-Cost Spanning Trees  Kruskal’s Algorithm — Developed by Joseph Kruskal (AT&T research).  Goal of minimum-cost spanning tree: 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.
  • 20. Chapter 2: Business Efficiency Critical Path Analysis  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.  Order-Requirement Digraph  A directed graph (digraph) that shows which tasks precede other tasks among the collection of tasks making up a job.  Critical Path  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.
  • 23. Skill Objectives (cont’d)  7. Explain the term heuristic algorithm and list both an advantage and a disadvantage.  8. Discuss the difficulties inherent in the application of the brute force method for finding the minimum-cost Hamiltonian circuit.  9. Describe the steps in the nearest-neighbor algorithm.  10. Find an approximate solution to the traveling salesman problem by applying the nearest-neighbor algorithm.  11. Describe the steps in the sorted-edges algorithm.  12. Find an approximate solution to the traveling salesman problem by applying the sorted-edges algorithm. .
  • 24. Skill Objectives (cont’d)  13. Give the definition of a tree.  14. Given a graph with edge weights, determine a minimum-cost spanning tree.  15. Identify the critical path in an order-requirement digraph.  16. Find the earliest possible completion time for a collection of tasks by finding the critical path in an order-requirement digraph.  17. Explain the difference between a graph and a directed graph.