Graph Theory CSRU1400, Fall 2007 Ellen Zhang.

Slides:



Advertisements
Similar presentations
22C:19 Discrete Math Graphs Fall 2010 Sukumar Ghosh.
Advertisements

22C:19 Discrete Math Graphs Fall 2014 Sukumar Ghosh.
Walks, Paths and Circuits Walks, Paths and Circuits Sanjay Jain, Lecturer, School of Computing.
Introduction to Graphs
9.7 Planar Graphs. Intro problem- 3 houses and 3 utilities K 3,3 problem: Can 3 houses be connected to 3 utilities so that no 2 lines cross? Similarly,
Applications of Euler’s Formula for Graphs Hannah Stevens.
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.
Last time: terminology reminder w Simple graph Vertex = node Edge Degree Weight Neighbours Complete Dual Bipartite Planar Cycle Tree Path Circuit Components.
Applied Combinatorics, 4th Ed. Alan Tucker
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?
Tucker, Applied Combinatorics, Section 1.4, prepared by Patti Bodkin
Graph Colouring Lecture 20: Nov 25.
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.
Curve Curve: The image of a continous map from [0,1] to R 2. Polygonal curve: A curve composed of finitely many line segments. Polygonal u,v-curve: A polygonal.
Problem: Induced Planar Graphs Tim Hayes Mentor: Dr. Fiorini.
22C:19 Discrete Math Graphs Spring 2014 Sukumar Ghosh.
GRAPH Learning Outcomes Students should be able to:
Graph Theory Ch6 Planar Graphs. Basic Definitions  curve, polygon curve, drawing  crossing, planar, planar embedding, and plane graph  open set  region,
Graph Theory Chapter 6 Planar Graphs Ch. 6. Planar Graphs.
Can you connect the dots as shown without taking your pen off the page or drawing the same line twice.
Basic Notions on Graphs. The House-and-Utilities Problem.
Planar Graphs Graph Coloring
Agenda Review: –Planar Graphs Lecture Content:  Concepts of Trees  Spanning Trees  Binary Trees Exercise.
1 12/2/2015 MATH 224 – Discrete Mathematics Formally a graph is just a collection of unordered or ordered pairs, where for example, if {a,b} G if a, b.
Introduction to Graph Theory
Unit – V Graph theory. Representation of Graphs Graph G (V, E,  ) V Set of vertices ESet of edges  Function that assigns vertices {v, w} to each edge.
Graph Colouring Lecture 20: Nov 25. This Lecture Graph coloring is another important problem in graph theory. It also has many applications, including.
Graph Theory and Applications
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.
Chap. 11 Graph Theory and Applications 1. Directed Graph 2.
Graph theory and networks. Basic definitions  A graph consists of points called vertices (or nodes) and lines called edges (or arcs). Each edge joins.
Graph Theory Unit: 4.
COMPSCI 102 Introduction to Discrete Mathematics.
Indian Institute of Technology Kharagpur PALLAB DASGUPTA Graph Theory: Planarity Pallab Dasgupta, Professor, Dept. of Computer Sc. and Engineering, IIT.
Chapter 7 Planar Graphs 大葉大學 資訊工程系 黃鈴玲  7.2 Planar Embeddings  7.3 Euler’s Formula and Consequences  7.4 Characterization of Planar Graphs.
(CSC 102) Lecture 30 Discrete Structures. Graphs.
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 Data Structures and Algorithms Graphs. 2 Graphs Basic Definitions Paths and Cycles Connectivity Other Properties Representation Examples of Graph Algorithms:
CS Lecture 22 Graph Theory. Can I draw the above figure in one continuous trace with no line being drawn twice?
Graphs. Representations of graphs : undirected graph An undirected graph G have five vertices and seven edges An adjacency-list representation of G The.
An Introduction to Graph Theory
Outline 1 Properties of Planar Graphs 5/4/2018.
Euler and Hamilton Cycles; Planar Graphs; Coloring.
Great Theoretical Ideas In Computer Science
Applied Combinatorics, 4th Ed. Alan Tucker
Graph theory Definitions Trees, cycles, directed graphs.
Planarity Testing.
Chapter 10.7 Planar Graphs These class notes are based on material from our textbook, Discrete Mathematics and Its Applications, 7th ed., by Kenneth H.
Graph Theory.
Graph.
Graphs Chapter 13.
Discrete Math II Howon Kim
Chapter 10.7 Planar Graphs These class notes are based on material from our textbook, Discrete Mathematics and Its Applications, 7th ed., by Kenneth H.
Applied Combinatorics, 4th Ed. Alan Tucker
Decision Maths Graphs.
MAT 2720 Discrete Mathematics
Chapter 15 Graph Theory © 2008 Pearson Addison-Wesley.
Planarity.
N(S) ={vV|uS,{u,v}E(G)}
Gaph Theory Planar Graphs
Discrete Mathematics for Computer Science
Introduction to Graph Theory
GRAPH THEORY Properties of Planar Graphs Ch9-1.
Planarity.
Agenda Review Lecture Content: Shortest Path Algorithm
Chapter 10.7 Planar Graphs These class notes are based on material from our textbook, Discrete Mathematics and Its Applications, 7th ed., by Kenneth H.
GRAPH THEORY Properties of Planar Graphs Ch9-1.
Presentation transcript:

Graph Theory CSRU1400, Fall 2007 Ellen Zhang

Outline Introduction to graph Is there a Eulerian trail, curcuit? Isomorphism and planarity Shortest path problem

Graph G=(V,E), V is the set of vertices (nodes), E is the set of edges Connected graph: where there is a path between any pair of distinct nodes A graph H is a subgraph of a G if all nodes and edges in H are also nodes and edges in G, i.e. H=(V’,E’) where A connected component of a graph G is a connected subgraph H of G such that no other connected subgraph of G containing H exists. Simple graph: no loop or parallel edges c a d b e f V={a, b, c, d, e, f} E={(a,b), (a,c), (a,d),(c,d), (b,d), (e,f)}

Walks in graph use every node edge nontrivial & only repeated node is first/last closed walk trail path circuit Eulerian trail Eulerian circuit cycle no repeated edge no repeated vertices Hamiltonian

Does a graph have an Eulerian trail ? C A Walk that go through all edges exactly once Proposition: in any graph, if a vertex x has an odd degree, then x cannot be an interior vertex (i.e., a vertex other than the starting or stopping point) in an Eulerian trail. For interior vertex: vs…e1xe2 … e3xe4 … ve A D B

What kind of graph has Eulerian circuit ? Graph G is called Eulerian if G has an Eulerian circuit (a closed walk that used every edge once and only once) Let G be a connected graph. G is Eulerian if and only if every node in G has even degree. 1 2 3 4 5 6 7 8 10 9

Construct Eulerian circuit Find any circuit C in graph G starting at a certain node, walking along unused edges until getting back to original node. Form a graph G’ by removing from G all edges in C and all vertices that have no edges left. G’ might not be connected G’ consists of graphs where every node has even degree; Use same process 1 to determine Eulerian circuits for G’ or its components. Piece together circuit C, and Eulerian curcuits found for G’, and get an Eulerian curcuit for G. 1 2 3 4 5 6 7 8 10 9

Eulerian Trail A connected graph G has an Eulerian trail if and only if G has exactly two nodes of odd degree. Moveover, the trail must begin and end at these two nodes If G has exactly two nodes of odd degree, after adding an edge connecting these two nodes, G has Eulerian circuit (by previous theorem). By removing added edge from circuit, we get a trail starting/ending at the two nodes. If G has an Eulerian trail, it’s easy to see that the starting/ending nodes have odd degree, all other nodes have even degree.

Example 1 Does this graph as Eulerian circuit or Eulerian trail ? Find the Eulerian circuit or trail.. 2 5 6 3 4

Outline Introduction to graph Is there a Eulerian trail, curcuit? Isomorphism and planarity Shortest path problem

Isomorphic Graphs Formal Def. Graph G and H are called isomorphic if there is a one-to-one correspondence f, between the vertices in G to vertices in H, so that (u,v) is edge in G if and only if (f(u),f(v)) is edge in H. One can rearrange G to get H z 3 4 y x u 1 v 2 5 6 w

Are these two graphs isomorphic ? ƒ(b) = 6 ƒ(c) = 8 ƒ(d) = 3 ƒ(g) = 5 ƒ(h) = 2 ƒ(i) = 4 ƒ(j) = 7

Checking isomorphism Two graphs that are isomorphic to one another must have Same number of nodes Same number of edges Same number of nodes of any given degree Same number of cycles Same number of cycles of any given size A pair of graphs satisfying above conditions are not necessarily isomorphic

Examples

Planar Graph Often we want to draw graphs as clean as possible, as few crossings as possible Can we connect three factories to three utilities without one service crossing over the other ? Three utilities Three factories

Definitions A graph is called planar if it can be drawn on a plane so that no edges cross. Such a drawing is called an embedding. Bipartite graph: the set of nodes can be partitioned into two sets so that every edge has one endpoint in one set, one endpoint in another set. Complete bipartite graph, Km,n, is a bipartite graph with nodes S1={a1,…,am} and S2={b1,…,bn}, and every nodes in S1 is connecting to every node in S2. Complete graph, Kn

Are these graphs planar? K4 K3,2 Kn,2

Are these graphs planar? K5 K3,3

Kuratowski’s Theorem A graph G is planar if and only if contains no “copies” of K3,3 or K5 as subgraphs A subdivision of a graph results from inserting vertices into edges More strictly speaking, a graph is planar if and only if it does not contain a subgraph that is a subdivision of K5 or K3,3.

Practice Problem Are the following graphs planar ?

Euler’s Formula for planar graph Def: for a planar graph G embedded in the plane, a face of the graph is a region of the plane created by the drawing. Note that we have one unbounded region. K4 a d b b

Euler’s Formula for Planar Graph Basic facts: Given an embedding of a graph, Removing any edge from a cycle decrease by 1 the num. of faces Every edge on a cycle borders exactly two faces For acyclic graph, # of faces is 1 Euler’s Formula: for any connected planar graph G embedded in the plane with V vertices, E edges and F faces, we have V+F=E+2. Can be proved (see the book) by induction.

Eular’s Formula Also holds for polyhedrons E=12,V=8,F=6 E=6 V=4 F=4

Polyhedra represented as Planar Graph Pick one face and stretch it out…

Now why K3,3 is not planar ? Prove by contradiction. If K3,3 is planar, then Since V=6, E=9, by Euler’s formula, V+F=E+2, F=5 But by another theorem, we have E>=2*F, i.e, F<=4.5. (See book P.542-543 for the detail). They cannot be both true, so our assumption (K3,3 is planar) is not true. So K3,3 is not planar

Outline Introduction to graph Is there a Eulerian trail, curcuit? Isomorphism and planarity Shortest path problem

Shortest Path Problem Given a weighted graph and two vertices, u and v, find a path with minimum total weights between u and v Applications: driving direction, flight reservation etc

Dijkstra’s Algorithm Find the shortest paths from a single source to all other nodes, for weighted graph where all weights are non-negative Ideas: Maintain a set S of vertices whose final shortest-path weights from source have been decided Select from V-S, a vertex with minimum shortest-path estimate, x, insert into S Do we get better paths now by going through x ? If so, updating shortest-path estimates for nodes in V-S Repeat until S=V, i.e., shortest path to all nodes have been determined

Idea of Dijkstra’s algorithm 9 6 ∞ ∞ 2 7 b c 2 11 2 ∞ 8 3 f 1 a 1 5 6 4 e d 3 ∞ 5 ∞ 5 S: nodes colored with red Label of vertex: the estimated or determined shortest-path weight Highlighted edges: used in the shortest paths

Practice Problem Find shortest path from f to all other nodes 7 b c 2 3 f 1 a 1 5 6 4 e d