Graph.

Slides:



Advertisements
Similar presentations
Chapter 8 Topics in Graph Theory
Advertisements

Chapter 9 Graphs.
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.
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
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.
Graph Colouring Lecture 20: Nov 25.
CTIS 154 Discrete Mathematics II1 8.2 Paths and Cycles Kadir A. Peker.
W. D. Grover TRLabs & University of Alberta © Wayne D. Grover 2002, 2003 Graph theory and routing (initial background) E E Lecture 4.
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.
Chapter 4 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.
Chapter 15 Graph Theory © 2008 Pearson Addison-Wesley.
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.
Planar Graphs: Euler's Formula and Coloring Graphs & Algorithms Lecture 7 TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.:
Can you connect the dots as shown without taking your pen off the page or drawing the same line twice.
Indian Institute of Technology Kharagpur PALLAB DASGUPTA Graph Theory: Introduction Pallab Dasgupta, Professor, Dept. of Computer Sc. and Engineering,
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.
An Introduction to Graph Theory
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.
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.
Indian Institute of Technology Kharagpur PALLAB DASGUPTA Graph Theory: Planarity Pallab Dasgupta, Professor, Dept. of Computer Sc. and Engineering, IIT.
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,
Chap 7 Graph Def 1: Simple graph G=(V,E) V : nonempty set of vertices E : set of unordered pairs of distinct elements of V called edges Def 2: Multigraph.
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:
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.
Homework 8 Graph G is given by the figure below.
Euler and Hamilton Cycles; Planar Graphs; Coloring.
Great Theoretical Ideas In Computer Science
Graph Theory CSRU1400, Fall 2007 Ellen Zhang.
Graph theory Definitions Trees, cycles, directed graphs.
Agenda Lecture Content: Introduction to Graph Path and Cycle
Graphs: As a mathematics branch
Topological Sort (topological order)
Planarity Testing.
Graph Theory.
Graphs Chapter 13.
CS 583 Analysis of Algorithms
Discrete Math II Howon Kim
Discrete Math II Howon Kim
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)}
Euler circuit Theorem 1 If a graph G has an Eulerian path, then it must have exactly two odd vertices. Theorem 2 If a graph G has an Eulerian circuit,
Gaph Theory Planar Graphs
Introduction to Graph Theory
GRAPH THEORY Properties of Planar Graphs Ch9-1.
Concepts of Computation
Agenda Review Lecture Content: Shortest Path Algorithm
GRAPH THEORY Properties of Planar Graphs Ch9-1.
Presentation transcript:

Graph

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 has 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

Two theorems 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 1. Find any curcuit C in graph G: starting at a certain node, walking along unused edges until getting back to original node. 2. Form a graph G’ by removing from G all edges in C and all vertices that have no edges left. 3. G’ consists of graphs where every node has even degree; Use same process 1 to determine Eulerian circuits for G’ or its components. 4. 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 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 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 graph is planar if and only if it does not contain a subgraph that is a subdivision of K5 or K3,3. A subdivision of a graph results from inserting vertices into edges

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 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 For any connected planar graph G embedded in the plane with V vertices, E edges and F faces, it must be the case that V+F=E+2 (Euler’s formula)

Now why 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 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, insert into S Updating shortest-path estimates for nodes in V-S Until S=V, 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