Street-Routing Problems

Similar documents
Minimal Spanning Trees

The Traveling Salesman Problem Brute Force Method

The Critical-Path Algorithm

The Traveling Salesman Problem Nearest-Neighbor Algorithm

Rotations and Translations

Recursive Sequences. Lecture 24 Section 5.6. Robb T. Koether. Hampden-Sydney College. Wed, Feb 27, 2013

Recursive Sequences. Lecture 24 Section 5.6. Robb T. Koether. Hampden-Sydney College. Wed, Feb 26, 2014

Nondeterministic Programming in C++

The Traveling Salesman Problem Cheapest-Link Algorithm

The Decreasing-Time Algorithm

Solving Recursive Sequences by Iteration

Sampling Distribution Examples Sections 15.4, 15.5

Review. Lecture 39. Robb T. Koether. Mon, Dec 5, Hampden-Sydney College. Robb T. Koether (Hampden-Sydney College) Review Mon, Dec 5, / 14

Boxplots. Lecture 17 Section Robb T. Koether. Hampden-Sydney College. Wed, Feb 10, 2010

Scope and Parameter Passing

Recursive Descent Parsers

while Loops Lecture 13 Sections Robb T. Koether Wed, Sep 26, 2018 Hampden-Sydney College

Stack Applications. Lecture 27 Sections Robb T. Koether. Hampden-Sydney College. Wed, Mar 29, 2017

The Class Construct Part 1

The Graphics Pipeline

Scheduling and Digraphs

The Pairwise-Comparison Method

Scope and Parameter Passing

Displaying Distributions - Quantitative Variables

The Plurality-with-Elimination Method

Recursion. Lecture 2 Sections Robb T. Koether. Hampden-Sydney College. Wed, Jan 17, 2018

Chapter 5: The Mathematics of Getting Around

Boolean Expressions. Lecture 31 Sections 6.6, 6.7. Robb T. Koether. Hampden-Sydney College. Wed, Apr 8, 2015

Binary Tree Applications

The CYK Parsing Algorithm

Abstract Data Types. Lecture 23 Section 7.1. Robb T. Koether. Hampden-Sydney College. Wed, Oct 24, 2012

Regular Expressions. Lecture 10 Sections Robb T. Koether. Hampden-Sydney College. Wed, Sep 14, 2016

Pointers. Lecture 1 Sections Robb T. Koether. Hampden-Sydney College. Wed, Jan 14, 2015

XPath. Lecture 36. Robb T. Koether. Wed, Apr 16, Hampden-Sydney College. Robb T. Koether (Hampden-Sydney College) XPath Wed, Apr 16, / 28

The Normal Distribution

The string Class. Lecture 21 Sections 2.9, 3.9, Robb T. Koether. Wed, Oct 17, Hampden-Sydney College

The Coefficient of Determination

Density Curves Sections

Introduction to Databases

Specular Reflection. Lecture 19. Robb T. Koether. Hampden-Sydney College. Wed, Oct 4, 2017

The Graphics Pipeline

MATH 101: Introduction to Contemporary Mathematics

Chapter 5: Euler Paths and Circuits The Mathematics of Getting Around

XPath Lecture 34. Robb T. Koether. Hampden-Sydney College. Wed, Apr 11, 2012

Chapter 5: Euler Paths and Circuits The Mathematics of Getting Around

Linked Lists. Lecture 16 Sections Robb T. Koether. Hampden-Sydney College. Wed, Feb 22, 2017

Building the Abstract Syntax Trees

Implementing Linked Lists

LR Parsing - Conflicts

Junior Circle Meeting 3 Circuits and Paths. April 18, 2010

Total Orders. Lecture 41 Section 8.5. Robb T. Koether. Hampden-Sydney College. Mon, Apr 8, 2013

Introduction to Compiler Design

Sections 5.2, 5.3. & 5.4

Chapter 14 Section 3 - Slide 1

The Projection Matrix

An Interactive Introduction to Graph Theory

Mipmaps. Lecture 35. Robb T. Koether. Hampden-Sydney College. Wed, Nov 18, 2015

Magnification and Minification

PHP Queries and HTML Forms Lecture 23

Ambient and Diffuse Light

XML Attributes. Lecture 33. Robb T. Koether. Hampden-Sydney College. Wed, Apr 25, 2018

Recognition of Tokens

Precept 4: Traveling Salesman Problem, Hierarchical Clustering. Qian Zhu 2/23/2011

Function Usage. Lecture 15 Sections 6.3, 6.4. Robb T. Koether. Hampden-Sydney College. Mon, Oct 1, 2018

14.2 Euler Paths and Circuits filled in.notebook November 18, Euler Paths and Euler Circuits

Pointer Arithmetic. Lecture 4 Chapter 10. Robb T. Koether. Hampden-Sydney College. Wed, Jan 25, 2017

Stack Applications. Lecture 25 Sections Robb T. Koether. Hampden-Sydney College. Mon, Mar 30, 2015

Section Graphs, Paths, and Circuits. Copyright 2013, 2010, 2007, Pearson, Education, Inc.

Function Definition Syntax Tree

Introduction to Databases

AQR UNIT 7. Circuits, Paths, and Graph Structures. Packet #

Aggregation. Lecture 7 Section Robb T. Koether. Hampden-Sydney College. Wed, Jan 29, 2014

Sarah Will Math 490 December 2, 2009

Recursive Linked Lists

Graph theory was invented by a mathematician named Euler in the 18th century. We will see some of the problems which motivated its study.

Operators. Lecture 12 Section Robb T. Koether. Hampden-Sydney College. Fri, Feb 9, 2018

MATH 113 Section 9.2: Topology

List Iterator Implementation

The Model Stack. Lecture 8. Robb T. Koether. Hampden-Sydney College. Wed, Sep 6, 2017

Relational Databases Lecture 2

The Mesh Class. Lecture 26. Robb T. Koether. Wed, Oct 28, Hampden-Sydney College

Recursion. Lecture 26 Sections , Robb T. Koether. Hampden-Sydney College. Mon, Apr 6, 2015

Shading Triangles. Lecture 37. Robb T. Koether. Hampden-Sydney College. Mon, Nov 30, 2015

Networks and Graphs: Circuits, Paths, and Graph Structures VII.A Student Activity Sheet 1: Euler Circuits and Paths

Networks and Graphs: Circuits, Paths, and Graph Structures VII.A Student Activity Sheet 1: Euler Circuits and Paths

Friends and Unary Operators

Introduction to Networks

Section Graphs, Paths, and Circuits. Copyright 2013, 2010, 2007, Pearson, Education, Inc.

Graph Theory

Webpage Navigation. Lecture 27. Robb T. Koether. Hampden-Sydney College. Mon, Apr 2, 2018

The Mesh Class. Lecture 23. Robb T. Koether. Hampden-Sydney College. Wed, Oct 18, 2017

Vertex-Edge Graphs. Vertex-Edge Graphs In the Georgia Performance Standards. Sarah Holliday Southern Polytechnic State University

The Class Construct Part 2

INTRODUCTION TO GRAPH THEORY. 1. Definitions

Form Validation. Lecture 25. Robb T. Koether. Hampden-Sydney College. Wed, Mar 23, 2018

Introduction to Engineering Systems, ESD.00. Networks. Lecturers: Professor Joseph Sussman Dr. Afreen Siddiqi TA: Regina Clewlow

The x86 Instruction Set

Inheritance: The Fundamental Functions

XQuery FLOWR Expressions Lecture 35

Math 443/543 Graph Theory Notes 2: Transportation problems

Transcription:

Street-Routing Problems Lecture 26 Sections 5.1-5.2 Robb T. Koether Hampden-Sydney College Wed, Oct 25, 2017 Robb T. Koether (Hampden-Sydney College) Street-Routing Problems Wed, Oct 25, 2017 1 / 21

1 Street-Routing Problems 2 Definitions 3 Examples 4 Assignment Robb T. Koether (Hampden-Sydney College) Street-Routing Problems Wed, Oct 25, 2017 2 / 21

Outline 1 Street-Routing Problems 2 Definitions 3 Examples 4 Assignment Robb T. Koether (Hampden-Sydney College) Street-Routing Problems Wed, Oct 25, 2017 3 / 21

Street-Routing Problems There are many problems that fall under the heading Street-Routing Problems. We will consider five of them. Robb T. Koether (Hampden-Sydney College) Street-Routing Problems Wed, Oct 25, 2017 4 / 21

Street-Routing Problems There are many problems that fall under the heading Street-Routing Problems. We will consider five of them. The Security Guard Problem Robb T. Koether (Hampden-Sydney College) Street-Routing Problems Wed, Oct 25, 2017 4 / 21

Street-Routing Problems There are many problems that fall under the heading Street-Routing Problems. We will consider five of them. The Security Guard Problem The Mail Carrier Problem Robb T. Koether (Hampden-Sydney College) Street-Routing Problems Wed, Oct 25, 2017 4 / 21

Street-Routing Problems There are many problems that fall under the heading Street-Routing Problems. We will consider five of them. The Security Guard Problem The Mail Carrier Problem The Königsberg Bridge Problem (famous) Robb T. Koether (Hampden-Sydney College) Street-Routing Problems Wed, Oct 25, 2017 4 / 21

Street-Routing Problems There are many problems that fall under the heading Street-Routing Problems. We will consider five of them. The Security Guard Problem The Mail Carrier Problem The Königsberg Bridge Problem (famous) The Bridges of Madison County Robb T. Koether (Hampden-Sydney College) Street-Routing Problems Wed, Oct 25, 2017 4 / 21

Street-Routing Problems There are many problems that fall under the heading Street-Routing Problems. We will consider five of them. The Security Guard Problem The Mail Carrier Problem The Königsberg Bridge Problem (famous) The Bridges of Madison County The Traveling Salesman Problem (famous) Robb T. Koether (Hampden-Sydney College) Street-Routing Problems Wed, Oct 25, 2017 4 / 21

The Security Guard Problem Example (The Security Guard Problem) A security guard must patrol every street of the neighborhood. What route should he follow to minimize the total distance? Must he walk some streets twice? Robb T. Koether (Hampden-Sydney College) Street-Routing Problems Wed, Oct 25, 2017 5 / 21

The Mail Carrier Problem Example (The Mail Carrier Problem) A mail carrier must deliver mail to both sides of every street of the neighborhood, except the boundary. What route should he follow to minimize the total distance? Must he walk some streets (same side) twice? Robb T. Koether (Hampden-Sydney College) Street-Routing Problems Wed, Oct 25, 2017 6 / 21

The Königsberg Problem Example (The Königsberg Problem) A Königsberger would like to take a stroll across the seven bridges of Königsberg. Can it be done without ever crossing the same bridge twice? Does it matter where the stroller starts? Robb T. Koether (Hampden-Sydney College) Street-Routing Problems Wed, Oct 25, 2017 7 / 21

The Bridges of Madison County Problem Example (The Bridges of Madison County Problem) A photographer wants to photograph each of the 11 bridges of Madison County. He must cross the bridge to photograph it and each bridge has a $5 toll. What route will minimize the total cost? Robb T. Koether (Hampden-Sydney College) Street-Routing Problems Wed, Oct 25, 2017 8 / 21

The Bridges of Madison County Problem Example (The Bridges of Madison County Problem) 1 3 2 5 4 6 7 8 9 10 11 A photographer wants to photograph each of the 11 bridges of Madison County. He must cross the bridge to photograph it and each bridge has a $5 toll. What route will minimize the total cost? Robb T. Koether (Hampden-Sydney College) Street-Routing Problems Wed, Oct 25, 2017 9 / 21

The Traveling Salesman Problem Example (The Traveling Salesman Problem) 8 B I 9 A 7 6 2 1 3 3 2 4 J 9 7 C 3 4 8 F 10 6 E 7 D 10 10 11 H 9 G A salesman is located in a city. He must make a trip during which he visits each of a number of other cities and return to his home city. He knows the distance from every city to every other city. What route will minimize the total distance traveled? Robb T. Koether (Hampden-Sydney College) Street-Routing Problems Wed, Oct 25, 2017 10 / 21

Outline 1 Street-Routing Problems 2 Definitions 3 Examples 4 Assignment Robb T. Koether (Hampden-Sydney College) Street-Routing Problems Wed, Oct 25, 2017 11 / 21

Definitions Definition A graph is a collection of vertices and edges. We normally draw the vertices as dots and the edges as lines. Each edge connects a pair of vertices. Robb T. Koether (Hampden-Sydney College) Street-Routing Problems Wed, Oct 25, 2017 12 / 21

Definitions We can give the vertices labels, e.g., A, B, C, etc. Then use those labels to identify the edges, e.g., AB, AC, etc. A B D E C Robb T. Koether (Hampden-Sydney College) Street-Routing Problems Wed, Oct 25, 2017 12 / 21

Definitions Definition (Path) A path is a sequence of edges, each edge adjacent to the next edge. We may denote a path by listing the vertices through which it passes. (E.g., DABC.) A B D E C Robb T. Koether (Hampden-Sydney College) Street-Routing Problems Wed, Oct 25, 2017 12 / 21

Definitions Definition (Circuit) A circuit is a path that begins and ends at the same vertex. (E.g., ABCA.) A B D E C Robb T. Koether (Hampden-Sydney College) Street-Routing Problems Wed, Oct 25, 2017 12 / 21

Definitions Definition (Weighted Graph) A weighted graph is a graph in which every edge is assigned a value (its weight). A 5 B 8 15 7 3 C D 12 E Robb T. Koether (Hampden-Sydney College) Street-Routing Problems Wed, Oct 25, 2017 12 / 21

Outline 1 Street-Routing Problems 2 Definitions 3 Examples 4 Assignment Robb T. Koether (Hampden-Sydney College) Street-Routing Problems Wed, Oct 25, 2017 13 / 21

Example Example (The Security Guard Problem) In the Security Guard Problem, we want a path that traverses every edge at least once and has the minimal total length. Robb T. Koether (Hampden-Sydney College) Street-Routing Problems Wed, Oct 25, 2017 14 / 21

Example Example (The Mail Carrier Problem) In the Mail Carrier Problem, we want a path that traverses every edge at least twice (except the boundary) and has the minimal total length. With the duplicated edges, the Mail Carrier Problem is the same as the Security Guard Problem. Robb T. Koether (Hampden-Sydney College) Street-Routing Problems Wed, Oct 25, 2017 15 / 21

Example Example (The Bridges of Königsberg Problem) In the Bridges of Königsberg Problem, we want a circuit that traverses each edge exactly once. Robb T. Koether (Hampden-Sydney College) Street-Routing Problems Wed, Oct 25, 2017 16 / 21

Example Example (The Bridges of Königsberg Problem) We draw a graph that shows only the relevant parts. Robb T. Koether (Hampden-Sydney College) Street-Routing Problems Wed, Oct 25, 2017 17 / 21

Example Example (The Bridges of Madison County Problem) In the Bridges of Madison County Problem, we want a circuit that traverses each edge at least once and has the minimal total length. This is the same as the Security Guard Problem. Robb T. Koether (Hampden-Sydney College) Street-Routing Problems Wed, Oct 25, 2017 18 / 21

Example Example (The Bridges of Madison County Problem) In the Bridges of Madison County Problem, we want a circuit that traverses each edge at least once and has the minimal total length. This is the same as the Security Guard Problem. Robb T. Koether (Hampden-Sydney College) Street-Routing Problems Wed, Oct 25, 2017 18 / 21

Example Example (The Traveling Salesman Problem) 8 B I 9 A 7 6 2 1 3 3 2 4 J 9 7 C 3 4 8 F 10 6 E 7 D 10 10 11 H 9 G In the Traveling Salesman Problem, we want a circuit that visits each vertex at least once and has the minimal total length. Robb T. Koether (Hampden-Sydney College) Street-Routing Problems Wed, Oct 25, 2017 19 / 21

Example Example (The Traveling Salesman Problem) A 8 11 B 6 7 8 C 10 D 9 I 10 11 15 4 J 15 17 11 11 F 9 14 E 7 H 9 G In the Traveling Salesman Problem, we want a circuit that visits each vertex at least once and has the minimal total length. Robb T. Koether (Hampden-Sydney College) Street-Routing Problems Wed, Oct 25, 2017 19 / 21

Outline 1 Street-Routing Problems 2 Definitions 3 Examples 4 Assignment Robb T. Koether (Hampden-Sydney College) Street-Routing Problems Wed, Oct 25, 2017 20 / 21

Assignment Assignment Chapter 5: Exercises 2, 3, 7, 13, 15, 19, 20, 21, 22, 27. Robb T. Koether (Hampden-Sydney College) Street-Routing Problems Wed, Oct 25, 2017 21 / 21