CS 15-251 Lecture 22 Graph Theory. Can I draw the above figure in one continuous trace with no line being drawn twice?

Slides:



Advertisements
Similar presentations
Lecture 5 Graph Theory. Graphs Graphs are the most useful model with computer science such as logical design, formal languages, communication network,
Advertisements

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.
Walks, Paths and Circuits Walks, Paths and Circuits Sanjay Jain, Lecturer, School of Computing.
Introduction to Graphs
1 Lecture 5 (part 2) Graphs II Euler and Hamiltonian Path / Circuit Reading: Epp Chp 11.2, 11.3.
Section 14.1 Intro to Graph Theory. Beginnings of Graph Theory Euler’s Konigsberg Bridge Problem (18 th c.)  Can one walk through town and cross all.
AMDM UNIT 7: Networks and Graphs
BY: MIKE BASHAM, Math in Scheduling. The Bridges of Konigsberg.
Koenigsberg bridge problem It is the Pregel River divided Koenigsberg into four distinct sections. Seven bridges connected the four portions of Koenigsberg.
Decision Maths Graphs Wiltshire Graphs A graph is just a diagram made up of “dots” and “lines”. These are all graphs. The dots are called “nodes” or.
Section 2.1 Euler Cycles Vocabulary CYCLE – a sequence of consecutively linked edges (x 1,x2),(x2,x3),…,(x n-1,x n ) whose starting vertex is the ending.
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?
Representing Graphs Wade Trappe. Lecture Overview Introduction Some Terminology –Paths Adjacency Matrix.
Homework collection Thursday 3/29 Read Pages 160 – 174 Page 185: 1, 3, 6, 7, 8, 9, 12 a-f, 15 – 20.
Drawing of G. Planar Embedding of G Proposition Proof. 1. Consider a drawing of K 5 or K 3,3 in the plane. Let C be a spanning cycle. 2. If the.
Complexity ©D.Moshkovitz 1 Paths On the Reasonability of Finding Paths in Graphs.
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.
Copyright © Cengage Learning. All rights reserved.
GRAPH Learning Outcomes Students should be able to:
1 Starter of the day 23 x 27 = x 47 = x 87 = x 55 = x 58 = ???? 54 x 56 = ???? Can you spot the trick for this group of.
5.1  Routing Problems: planning and design of delivery routes.  Euler Circuit Problems: Type of routing problem also known as transversability problem.
Introduction to Graph Theory
1.5 Graph Theory. Graph Theory The Branch of mathematics in which graphs and networks are used to solve problems.
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.
Associated Matrices of Vertex Edge Graphs Euler Paths and Circuits Block Days April 30, May 1 and May
Graph theory and networks. Basic definitions  A graph consists of points called vertices (or nodes) and lines called edges (or arcs). Each edge joins.
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.
Eulerian Paths and Cycles. What is a Eulerian Path Given an graph. Find a path which uses every edge exactly once. This path is called an Eulerian Path.
Lecture 52 Section 11.2 Wed, Apr 26, 2006
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
COMPSCI 102 Introduction to Discrete Mathematics.
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
Graphs. Representations of graphs : undirected graph An undirected graph G have five vertices and seven edges An adjacency-list representation of G The.
MAT 110 Workshop Created by Michael Brown, Haden McDonald & Myra Bentley for use by the Center for Academic Support.
An Introduction to Graph Theory
Excursions in Modern Mathematics Sixth Edition
EECS 203 Lecture 19 Graphs.
Euler and Hamiltonian Graphs
Graphs: Definitions and Basic Properties
Graphs Hubert Chan (Chapter 9) [O1 Abstract Concepts]
Graph Theory CSRU1400, Fall 2007 Ellen Zhang.
Euler Paths and Circuits
Graph theory Definitions Trees, cycles, directed graphs.
Eulerian tours Miles Jones MTThF 8:30-9:50am CSE 4140 August 15, 2016.
Konigsberg’s Seven Bridges
EECS 203 Lecture 20 More Graphs.
Introduction to Graph Theory
Discrete Maths 9. Graphs Objective
Can you draw this picture without lifting up your pen/pencil?
Euler Paths and Circuits
Introduction to Graph Theory Euler and Hamilton Paths and Circuits
Graph Theory.
Graph.
Lecture 15: Graph Theory II
Graphs Chapter 13.
Konigsberg- in days past.
Decision Maths Graphs.
Graph Theory What is a graph?.
Representing Graphs Wade Trappe.
Euler Circuits and Paths
Euler and Hamilton Paths
Discrete Mathematics for Computer Science
Applied Combinatorics, 4th Ed. Alan Tucker
Chapter 10 Graphs and Trees
Warm Up – 3/17 - Monday A) List the set of vertices.
Graph Theory Proof In Class Exercise.
Presentation transcript:

CS Lecture 22 Graph Theory

Can I draw the above figure in one continuous trace with no line being drawn twice?

How about this one?

The residents of Königsberg, Germany, wondered if it was possible to take a walking tour of the town that crossed each of the seven bridges over the Presel river exactly once. Leonard Euler 1736 (father of graph theory) Picture only what is essential to the problem.

Is it possible to start at some node and take a walk that uses each edge exactly once, and ends at the starting node?

You can redraw the original picture as long as for every edge between nodes i and j in the original you put an edge between nodes i and j in the redrawn version (and you put no other edges in the redrawn version). Original: Redrawn:

Let’s prove a general theorem that answers this question for any given graph. Has no tour that uses each edge exactly once. (Even if we allow the walk to start and finish in different places.) Can you see why? Euler:

A walk in a graph is called an Euler tour if it starts and ends in the same place and uses each edge exactly once. A walk in a graph is called an Euler trail if it uses each edge exactly once. If a graph has an Euler tour, it is said to be an Eulerian graph.

The problem in our language: Show that is not Eulerian. In fact, it contains no Euler trail.

Two nodes (vertices) are adjacent if there is at least one edge between them. The degree of a vertex is the number of edges emanating from it. Definitions: A graph is connected if it is possible to walk from any vertex to any other vertex. connected graph Note: Each loop counts as two edges emanating from a node. This node has degree 5.

Theorem (Euler): 1. G is Eulerian, no degree- 0 nodes  G is connected and has no vertices of odd degree 2. G is has an Euler trail from node a to some other node b, no degree- 0 nodes  G is connected and a  b are the only two nodes of odd degree

Proof: Assume G has an Euler trail C from node a to node b ( a and b not necessarily distinct). 1.  2.  G is certainly connected, since the Euler trail reaches every edge (and hence every node) of G. For every node besides a and b, C uses an edge to exit for each edge it uses to enter. Thus, the degree of the node is even. 1. If a = b, then a also has even degree. 2. If a  b, then a and b both have odd degree.

1.  2.  Assume G is connected. If there are no odd- degree nodes, pick any a = b. If there are two odd-degree nodes, call these nodes a and b. Start at a. Take a walk w 1 until you get stuck. You must be at b. Incorporate this walk from v into w 1. a b v If no vertex along w 1 has an unused edge, we are done. Otherwise, call this vertex v. Walk from v until you get stuck. You must be back at v.

A directed graph is a graph where each edge is directed from one of its endpoints to the other. The theorem remains true for any connected, directed graph where # of edges leaving a node = # of edges coming in Example:

A graph has a Hamiltonian tour if there is a tour that visits every vertex exactly once (and returns to its starting point). A graph with a Hamiltonian tour is called a Hamiltonian graph.

A graph of the vertices of a dodecahedron. Is it Hamiltonian? Yes.

This one has a Hamiltonian path, but not a Hamiltonian tour. This one has a trail.

Given a graph, what is a nice way to determine if it is Hamiltonian?

No one knows. Deciding if a graph is Hamiltonian is NP  complete. There is probably no nice characterization of Hamiltonian graphs the way there was with Euler graphs.

Ancient Sanskrit Nonsense YAMÁTÁRÁJABHÁNASALAGÁM This will not be on the final.

YA MÁ TÁ RÁ JA BHÁ NA SA LA GÁM It’s a memory aid from the Indian theory of rhythms.

address decoder Modern application: memory wheel Rotating memory drum

Is there a memory wheel with 16 bits in which all 4 -bit patterns occur? Is there a memory wheel with 2 n bits in which all n -bit patterns occur?

There is an arrow from node a to node b if the last two bits in a equal the first two bits in b. There is a 1-1 correspondence between Hamiltonian tours of this graph and memory wheels with 8 bits

Hamiltonian graph?

Perhaps a different graph can represent the same problem. Hint: It’s better to be looking for Eulerian tours than Hamiltonian tours.

Idea: Instead of having the nodes be the 3 -bit patterns, and putting an edge between patterns with a 2 -bit overlap,…… ab bc cd abc bcd Have the nodes be the 2 -bit overlap and the edges the 3 -bit pattern.

Every Euler tour corresponds to a memory wheel

Theorem: For every n, there exists a memory wheel of size 2 n that has all n -bit patterns. Proof: There are 2 edges in and 2 edges out of every vertex. Graph is connected – can find path from any a to any b.Thus the graph is Eulerian. Every Euler tour corresponds to a memory wheel.