EECS 203: It’s the end of the class and I feel fine. Graphs.

Slides:



Advertisements
Similar presentations
CSE 211 Discrete Mathematics
Advertisements

Lecture 5 Graph Theory. Graphs Graphs are the most useful model with computer science such as logical design, formal languages, communication network,
22C:19 Discrete Math Graphs Fall 2010 Sukumar Ghosh.
Introduction to Graph Theory Instructor: Dr. Chaudhary Department of Computer Science Millersville University Reading Assignment Chapter 1.
22C:19 Discrete Math Graphs Fall 2014 Sukumar Ghosh.
Midwestern State University Department of Computer Science Dr. Ranette Halverson CMPS 2433 – CHAPTER 4 GRAPHS 1.
Graph-02.
Introduction to Graphs
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.
1 Lecture 5 (part 2) Graphs II Euler and Hamiltonian Path / Circuit Reading: Epp Chp 11.2, 11.3.
Lecture 21 Paths and Circuits CSCI – 1900 Mathematics for Computer Science Fall 2014 Bill Pine.
© 2006 Pearson Addison-Wesley. All rights reserved14 A-1 Chapter 14 Graphs.
Discrete Structures Chapter 7B Graphs Nurul Amelina Nasharuddin Multimedia Department.
Introduction to Graphs Lecture 18: Nov 16. Seven Bridges of Königsberg Is it possible to walk with a route that crosses each bridge exactly once?
IEOR266 © Classification of MCNF problems.
4/17/2017 Section 8.5 Euler & Hamilton Paths ch8.5.
Euler and Hamilton Paths
22C:19 Discrete Math Graphs Spring 2014 Sukumar Ghosh.
Euler Paths and Circuits. The original problem A resident of Konigsberg wrote to Leonard Euler saying that a popular pastime for couples was to try.
GRAPH Learning Outcomes Students should be able to:
Graph Theoretic Concepts. What is a graph? A set of vertices (or nodes) linked by edges Mathematically, we often write G = (V,E)  V: set of vertices,
Graph Theory Topics to be covered:
Euler and Hamilton Paths
Structures 7 Decision Maths: Graph Theory, Networks and Algorithms.
Can you connect the dots as shown without taking your pen off the page or drawing the same line twice.
Euler and Hamilton Paths. Euler Paths and Circuits The Seven bridges of Königsberg a b c d A B C D.
CSE 326: Data Structures NP Completeness Ben Lerner Summer 2007.
CS 200 Algorithms and Data Structures
5.4 Graph Models (part I – simple graphs). Graph is the tool for describing real-life situation. The process of using mathematical concept to solve real-life.
Data Structures & Algorithms Graphs
Fall 2015 COMP 2300 Discrete Structures for Computation Donghyun (David) Kim Department of Mathematics and Physics North Carolina Central University 1.
Topics Paths and Circuits (11.2) A B C D E F G.
Introduction to Graphs. This Lecture In this part we will study some basic graph theory. Graph is a useful concept to model many problems in computer.
CIRCUITS, PATHS, AND SCHEDULES Euler and Königsberg.
Associated Matrices of Vertex Edge Graphs Euler Paths and Circuits Block Days April 30, May 1 and May
Euler Paths and Circuits. The original problem A resident of Konigsberg wrote to Leonard Euler saying that a popular pastime for couples was to try.
1.Quiz 5 due tomorrow afternoon in E309 from 1pm to 4pm. 2.Homework grades will be based on ten graded homework assignments (dropping the lowest one).
Lecture 52 Section 11.2 Wed, Apr 26, 2006
Lecture 11: 9.4 Connectivity Paths in Undirected & Directed Graphs Graph Isomorphisms Counting Paths between Vertices 9.5 Euler and Hamilton Paths Euler.
Chapter 6: Graphs 6.1 Euler Circuits
Review Euler Graph Theory: DEFINITION: A NETWORK IS A FIGURE MADE UP OF POINTS (VERTICES) CONNECTED BY NON-INTERSECTING CURVES (ARCS). DEFINITION: A VERTEX.
Introduction to Graph Theory
1) Find and label the degree of each vertex in the graph.
Euler and Hamiltonian Graphs
Graphs Rosen, Chapter 8. NOT ONE OF THESE! One of these!
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,
1 GRAPH Learning Outcomes Students should be able to: Explain basic terminology of a graph Identify Euler and Hamiltonian cycle Represent graphs using.
1 Lecture 5 (part 2) Graphs II (a) Circuits; (b) Representation Reading: Epp Chp 11.2, 11.3
Hamiltonian Graphs Graphs Hubert Chan (Chapter 9.5)
EECS 203 Lecture 19 Graphs.
Routing Through Networks - 1
Euler and Hamiltonian Graphs
Euler Paths and Circuits
Graphs Rosen, Chapter 8.
Graph theory Definitions Trees, cycles, directed graphs.
Eulerian tours Miles Jones MTThF 8:30-9:50am CSE 4140 August 15, 2016.
Agenda Lecture Content: Introduction to Graph Path and Cycle
Discrete Structures – CNS2300
Hamiltonian Graphs Graphs Hubert Chan (Chapter 9.5)
EECS 203 Lecture 20 More Graphs.
Discrete Maths 9. Graphs Objective
Introduction to Graph Theory Euler and Hamilton Paths and Circuits
Graph Theory.
Graphs Chapter 13.
Genome Assembly.
Foundations of Discrete Mathematics
Konigsberg- in days past.
Euler and Hamilton Paths
Euler and Hamiltonian Graphs
Graph Theory Relations, graphs
Presentation transcript:

EECS 203: It’s the end of the class and I feel fine. Graphs

Admin stuffs Last homework due today I’ll stick around after class for questions I’ll have different office hours next week. Monday 1-2:30 (my office or as on door) Tuesday 10:30-12:00(my office or as on door) Wed. 10:30-12:00 (classroom) Thursday 10:30-12:00 (classroom) Aaron’s hours will be announced shortly. Discussion is still on for Friday. We’ll be posting a set of topics to know for the final on Piazza. Extra credit stuff posted tomorrow and due Wed.

Today Dijkstra’s algorithm Using slides from

Dijkstra’s Algorithm animated

Let’s try an induction proof on a graph First we’ll define what it means for a graph to be connected. Then we’ll show that in any connected graph there are at least two vertices you can remove from the graph (along with its incident edges) that leave the graph still connected. We’ll use strong induction. First let’s (re)define some terms

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.

From: There are a few nice observations about the proof there as well as a few nice induction examples.

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? Circuit Path Not Traversable C A E C B A E C B AAA BBB CCC DDD E E E

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? O P N M (A) Yes (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

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) dodecahedronIsomorphic graph solution

Hamilton circuit Do these graphs have Hamilton circuits? G H (A) Yes, both. (C ) G doesn’t, H does. (B) G does, H doesn’t. (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. 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? (A) 16 (B) 17 (C ) 18 (D) 19 (E)

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

And finish up 203 We have covered a massive amount of material. And believe it or not, it is mostly something you’ll use again if you are in CS. Proofs in 376 (and a bit in 281, 477, 478, 492 and a few other places) Graphs in 281 and many programming tasks Logic and sets in programming Growth of functions in algorithm development (and 281) Recursion relations in 281 and 477. Etc.

The language of Computer Science But IMO the largest benefit is the language. You hopefully can talk about sets, growth of functions and whatever else without feeling lost. That is actually the biggest difference between someone with a CS degree and a programmer without one. You have the language to discuss topics. You know what a proof looks like You can reason about things in a formal way when things need it.  Monty Hall problem for example. Honestly, the details will fade. But the ideas should stick and will be useful.