EECS 203 Lecture 20. More Graphs

Similar documents
Worksheet 28: Wednesday November 18 Euler and Topology

6.2. Paths and Cycles

V1.0: Seth Gilbert, V1.1: Steven Halim August 30, Abstract. d(e), and we assume that the distance function is non-negative (i.e., d(x, y) 0).

Discrete Mathematics for CS Spring 2008 David Wagner Note 13. An Introduction to Graphs

IE 102 Spring Routing Through Networks - 1

Elements of Graph Theory

GRAPHS, GRAPH MODELS, GRAPH TERMINOLOGY, AND SPECIAL TYPES OF GRAPHS

CS70 - Lecture 6. Graphs: Coloring; Special Graphs. 1. Review of L5 2. Planar Five Color Theorem 3. Special Graphs:

Graph Traversals. CSC 1300 Discrete Structures Villanova University. Villanova CSC Dr Papalaskari 1

Intermediate Math Circles Wednesday, February 22, 2017 Graph Theory III

Ma/CS 6a Class 8: Eulerian Cycles

PATH FINDING AND GRAPH TRAVERSAL

Math 776 Graph Theory Lecture Note 1 Basic concepts

Varying Applications (examples)

Crossing bridges. Crossing bridges Great Ideas in Theoretical Computer Science. Lecture 12: Graphs I: The Basics. Königsberg (Prussia)

Chapter 14 Section 3 - Slide 1

Theory of Computing. Lecture 10 MAS 714 Hartmut Klauck

Introduction III. Graphs. Motivations I. Introduction IV

Classic Graph Theory Problems

Notes slides from before lecture. CSE 21, Winter 2017, Section A00. Lecture 9 Notes. Class URL:

3 Euler Tours, Hamilton Cycles, and Their Applications

Discrete mathematics

Discrete Mathematics and Probability Theory Fall 2009 Satish Rao,David Tse Note 8

v V Question: How many edges are there in a graph with 10 vertices each of degree 6?

Graph Theory. 1 Introduction to Graphs. Martin Stynes Department of Mathematics, UCC January 26, 2011

Graph Theory. Part of Texas Counties.

Discrete Mathematics and Probability Theory Fall 2013 Vazirani Note 7

Lecture 5: Graphs. Rajat Mittal. IIT Kanpur

Majority and Friendship Paradoxes

Euler and Hamilton paths. Jorge A. Cobb The University of Texas at Dallas

Chapter 3: Paths and Cycles

Worksheet for the Final Exam - Part I. Graphs

Design and Analysis of Algorithms

Questions? You are given the complete graph of Facebook. What questions would you ask? (What questions could we hope to answer?)

SCHOOL OF ENGINEERING & BUILT ENVIRONMENT. Mathematics. An Introduction to Graph Theory

How can we lay cable at minimum cost to make every telephone reachable from every other? What is the fastest route between two given cities?

CHAPTER 10 GRAPHS AND TREES. Alessandro Artale UniBZ - artale/z

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

val(y, I) α (9.0.2) α (9.0.3)

Section 3.4 Basic Results of Graph Theory

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

Graphs and Algorithms 2016

Module 2: NETWORKS AND DECISION MATHEMATICS

An Introduction to Graph Theory

CS270 Combinatorial Algorithms & Data Structures Spring Lecture 19:

Major Themes. Graph Traversals. Euler s SoluWon to The Bridges of Königsberg. The Bridges of Königsberg Puzzle. Dr Papalaskari 1

Number Theory and Graph Theory

Graphs II: Trailblazing

Introduction to Graph Theory

Eulerian Cycle (2A) Walk : vertices may repeat, edges may repeat (closed or open) Trail: vertices may repeat, edges cannot repeat (open)

Further Mathematics 2016 Module 2: NETWORKS AND DECISION MATHEMATICS Chapter 9 Undirected Graphs and Networks

Introduction to Graphs

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

1 Variations of the Traveling Salesman Problem

Artificial Intelligence

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

Eulerian Cycle (2A) Young Won Lim 4/26/18

Discrete Math For Computing II

Graph Theory CS/Math231 Discrete Mathematics Spring2015

Eulerian Tours and Fleury s Algorithm

Networks: Lecture 1. General Comments

Best known solution time is Ω(V!) Check every permutation of vertices to see if there is a graph edge between adjacent vertices

Traveling Salesperson Problem (TSP)

CMSC 451: Lecture 22 Approximation Algorithms: Vertex Cover and TSP Tuesday, Dec 5, 2017

1. The Highway Inspector s Problem

1. a graph G = (V (G), E(G)) consists of a set V (G) of vertices, and a set E(G) of edges (edges are pairs of elements of V (G))

GRAPH THEORY and APPLICATIONS. Matchings

Partha Sarathi Mandal

Approximation Algorithms

Basic Combinatorics. Math 40210, Section 01 Fall Homework 4 Solutions

Discussion. What problems stretch the limits of computation? Compare 4 Algorithms. What is Brilliance? 11/11/11

NP-Hard (A) (B) (C) (D) 3 n 2 n TSP-Min any Instance V, E Question: Hamiltonian Cycle TSP V, n 22 n E u, v V H

Design and Analysis of Algorithms

Math 443/543 Graph Theory Notes 2: Transportation problems

1. Read each problem carefully and follow the instructions.

Fundamental Properties of Graphs

Lecture 5: Graphs. Graphs! Euler Definitions: model. Fact! Euler Again!! Planar graphs. Euler Again!!!!

Coping with NP-Completeness

Chapter 9 Graph Algorithms

Graphs and Puzzles. Eulerian and Hamiltonian Tours.

More NP-complete Problems. CS255 Chris Pollett May 3, 2006.

Chapter 9 Graph Algorithms

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

INTRODUCTION TO GRAPH THEORY. 1. Definitions

Institute of Operating Systems and Computer Networks Algorithms Group. Network Algorithms. Tutorial 4: Matching and other stuff

Graph (1A) Young Won Lim 4/19/18

WUCT121. Discrete Mathematics. Graphs

Understand graph terminology Implement graphs using

Lecture 8: The Traveling Salesman Problem

Graphs (MTAT , 6 EAP) Lectures: Mon 14-16, hall 404 Exercises: Wed 14-16, hall 402

Math 778S Spectral Graph Theory Handout #2: Basic graph theory

Module 11: Additional Topics Graph Theory and Applications

Math for Liberal Arts MAT 110: Chapter 13 Notes

Week 11: Eulerian and Hamiltonian graphs; Trees. 15 and 17 November, 2017

Graphs. Pseudograph: multiple edges and loops allowed

Today s Outline. CSE 326: Data Structures. Topic #15: Cool Graphs n Pretty Pictures. A Great Mathematician. The Bridges of Königsberg

Brief History. Graph Theory. What is a graph? Types of graphs Directed graph: a graph that has edges with specific directions

Graphs and Isomorphisms

Traveling Salesman Problem (TSP) Input: undirected graph G=(V,E), c: E R + Goal: find a tour (Hamiltonian cycle) of minimum cost

Eulerian tours. Russell Impagliazzo and Miles Jones Thanks to Janine Tiefenbruck. April 20, 2016

Transcription:

EECS 203 Lecture 20 More Graphs

Admin stuffs Last homework due today Office hour changes starting Friday (also in Piazza) Friday 6/17: 2-5 Mark in his office. Sunday 6/19: 2-5 Jasmine in the UGLI. Monday 6/20: 10-12 Mark in his office. Monday 6/20: 5-7 Emily in the UGLI. Tuesday 6/21: 10-12 Emily in the Beyster Learning Center. Tuesday 6/21: 1-3 Mark in his office. Wednesday 6/22: 10-12 Emily in the Beyster Learning Center. Wednesday 6/22: 1:30-3 Mark in his office. Thursday: 6/23: 10-12 Emily in the Beyster Learning Center. Thursday 6/23: 1:30-3 Jasmine in the Beyster Learning Center. Discussion is still on for Thursday and Friday. Exam is Thursday 6/23 from 4-6 Room information posted shortly (will be in EECS)

Last time Defined some terms G=(V,E) Directed vs undirected graph What it means to be connected Etc. Did Dijkstra s Algorithm Finds shortest path between a pair of nodes Didn t analyze runtime though Started on induction proof about connectivity.

Today Analyze Dijkstra s Algorithm Deal with induction proof we started on last time. Look at a way of finding all-pairs shortest path distances Floyd-Warshall Algorithm More terminology Path, cycle, Eulerian path, Eulerian cycle, other graph applications (Time allowing)more terminology Trees, minimum-spanning trees (MST), planar graphs Brief overview of ideas associated with these things.

Let s examine Dijkstra s Algorithm What is the worst-case run time on a graph with V nodes?

Today Analyze Dijkstra s Algorithm Deal with induction proof we started on last time. Look at a way of finding all-pairs shortest path distances Floyd-Warshall Algorithm More terminology Path, cycle, Eulerian path, Eulerian cycle More terminology Trees, minimum-spanning trees (MST), planar graphs Brief overview of ideas associated with these things.

From: http://www.sfu.ca/~mdevos/notes/graph/induction.pdf There are a few nice observations about the proof there as well as a few nice induction examples.

Today Analyze Dijkstra s Algorithm Deal with induction proof we started on last time. Look at a way of finding all-pairs shortest path distances Floyd-Warshall Algorithm More terminology Path, Cycle, Eulerian path, Eulerian cycle More terminology Trees, minimum-spanning trees (MST), planar graphs Brief overview of ideas associated with these things.

Floyd-Warshall Algorithm What is it doing? Why does it work?

Floyd-Warshall Algorithm Dist 1 2 3 4 1 0 2 2 3 1 4

Today Analyze Dijkstra s Algorithm Deal with induction proof we started on last time. Look at a way of finding all-pairs shortest path distances Floyd-Warshall Algorithm More terminology Path, Cycle, Eulerian path, Eulerian cycle More terminology Trees, minimum-spanning trees (MST), planar graphs Brief overview of ideas associated with these things.

Graphs A graph G = (V,E) consists of a non-empty set V of vertices (or nodes), and a set E of edges. Each edge is associated with two vertices (possibly equal), which are its endpoints. A path from u to v of length n is: a sequence of edges e 1, e 2,... e n in E, such that there is a sequence of vertices u=v 0, v 1,... v n =v such that each e i has endpoints v i-1 and v i. A path is a circuit when u=v. A graph is connected when there exists a path from every vertex to every other vertex.

Paths and Circuits Given a graph G = (V,E): Is there a path/circuit that crosses each edge in E exactly once? If so, G is an Eulerian graph, and you have an Eulerian path, or an Eulerian circuit. Is there a path/circuit that visits each vertex in V exactly once? If so, G is a Hamiltonian graph, and you have a Hamiltonian path or circuit.

Leonhard Euler lived in Königsberg He liked to take walks. A famous local puzzle was whether you could take a walk that would cross each bridge exactly once. Euler solved this problem (in 1736) and thus founded graph theory.

The Graph Abstraction In the physical world: Each bridge connects exactly two land-masses. Each land-mass may have any number of bridges. Suggests a graph abstraction: Represent a bridge by an edge in the graph. Represent a land-mass by a vertex.

Is there an Euler circuit/path? A A A A A B C D B B C D B B C D C C C E E E E E Circuit Path Not Traversable

Does G have an Euler Path/Circuit? Theorem: A connected multigraph has an Euler path iff it has exactly zero or two vertices of odd degree. Why? What if it has only one? When does it have an Euler circuit?

Examples Do these graphs have Euler paths/circuits? (A)Yes, it has a circuit. (B)Yes, it has a path (but no circuit). (C)No, it has neither path nor circuit.

Does this have an Euler path? M O N (A) Yes P (B) No

Applications of Euler Paths Planning routes through graphs that provide efficient coverage of the edges in the graph, without multiple traversals. Postal delivery routes Snowplowing routes Testing network connections Utility transmission network Communication network

Eulerian Path vs. Hamiltonian Path Eulerian: Traverse each edge exactly once Hamiltonian Traverse each node exactly once

Hamiltonian Paths and Circuits Given a graph, is there a path that passes through each vertex in the graph exactly once? (aka a Hamiltonian path) dodecahedron Isomorphic graph solution

Hamilton circuit Do these graphs have Hamilton circuits? 3 4 6 G 1 2 H 5 (A) Yes, both. (B) G does, H doesn t. (C ) G doesn t, H does. (D) No, neither.

Computational Complexity Deciding whether a graph is Eulerian is a simple examination of the degrees of the vertices. Simple linear-time algorithms exist for finding the path or circuit. Deciding whether a graph is Hamiltonian is, in general, much more difficult ( NP complete ). Finding a Hamiltonian path or circuit is equally hard.

Weighted graphs A weighted graph has numbers (weights) assigned to each edge. 5 3 4 6 3 4 The length of a path is the sum of the weights in the path.

Traveling Salesperson s Problem What is the shortest route in a given map for a salesperson to visit every city exactly once and return home at the end? Mathematically: Given an graph with weighted edges, what is the Hamiltonian circuit of least weight? Applies to both directed and undirected graphs.

The Traveling Salesman Problem Problem: Given a graph G, find the shortest possible length for a Hamilton circuit. What is the solution to TSP for the following graph? 3 2 5 4 6 7 (A) 16 (B) 17 (C ) 18 (D) 19 (E) 20

Traveling Salesperson s Problem The TSP is NP Complete: intractable in general. Very large instances have been solved with heuristics. An instance with 13,509 cities, solved in 2003.

Applications The Traveling Salesperson s Problem and the Hamilton Path/Circuit Problem have many applications. Planning and logistics (of course!) Manufacture of microchips DNA sequencing