Graph Theory in Networks Lecture 3, 9/7/04 EE 228A, Fall 2004 Rajarshi Gupta University of California, Berkeley.

Slides:



Advertisements
Similar presentations
Chapter 5: Tree Constructions
Advertisements

CS 336 March 19, 2012 Tandy Warnow.
Great Theoretical Ideas in Computer Science
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.
Bipartite Matching, Extremal Problems, Matrix Tree Theorem.
Greedy Algorithms Greed is good. (Some of the time)
Great Theoretical Ideas in Computer Science for Some.
Graphs III (Trees, MSTs) (Chp 11.5, 11.6)
Great Theoretical Ideas in Computer Science.
Last time: terminology reminder w Simple graph Vertex = node Edge Degree Weight Neighbours Complete Dual Bipartite Planar Cycle Tree Path Circuit Components.
Data Structures, Spring 2004 © L. Joskowicz 1 Data Structures – LECTURE 14 Strongly connected components Definition and motivation Algorithm Chapter 22.5.
1 Discrete Structures & Algorithms Graphs and Trees: II EECE 320.
Spanning Trees.
Computational Geometry Seminar Lecture 1
Perfect Graphs Lecture 23: Apr 17. Hard Optimization Problems Independent set Clique Colouring Clique cover Hard to approximate within a factor of coding.
Great Theoretical Ideas in Computer Science.
Greedy Algorithms Reading Material: Chapter 8 (Except Section 8.5)
Graph Colouring Lecture 20: Nov 25.
Graph Theory in Networks Lecture 3, 9/7/04 EE 228A, Fall 2004 Rajarshi Gupta University of California, Berkeley.
Communication Networks A Second Course Jean Walrand Department of EECS University of California at Berkeley.
Maximal Cliques in UDG: Polynomial Approximation Rajarshi Gupta, Jean Walrand Dept of EECS, UC Berkeley Olivier Goldschmidt, OPNET Technologies International.
Coloring Algorithms and Networks. Coloring2 Graph coloring Vertex coloring: –Function f: V  C, such that for all {v,w}  E: f(v)  f(w) Chromatic number.
Data Structures, Spring 2006 © L. Joskowicz 1 Data Structures – LECTURE 14 Strongly connected components Definition and motivation Algorithm Chapter 22.5.
Greedy Algorithms Like dynamic programming algorithms, greedy algorithms are usually designed to solve optimization problems Unlike dynamic programming.
Minimum Spanning Trees
Discrete Mathematics Lecture 9 Alexander Bukharovich New York University.
22C:19 Discrete Math Graphs Spring 2014 Sukumar Ghosh.
Graph Algorithms Using Depth First Search Prepared by John Reif, Ph.D. Distinguished Professor of Computer Science Duke University Analysis of Algorithms.
Graph Theory Chapter 6 Planar Graphs Ch. 6. Planar Graphs.
Minimal Spanning Trees What is a minimal spanning tree (MST) and how to find one.
IS 2610: Data Structures Graph April 5, 2004.
Theory of Computing Lecture 10 MAS 714 Hartmut Klauck.
Nattee Niparnan. Easy & Hard Problem What is “difficulty” of problem? Difficult for computer scientist to derive algorithm for the problem? Difficult.
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.:
1 ELEC692 Fall 2004 Lecture 1b ELEC692 Lecture 1a Introduction to graph theory and algorithm.
Approximating the Minimum Degree Spanning Tree to within One from the Optimal Degree R 陳建霖 R 宋彥朋 B 楊鈞羽 R 郭慶徵 R
Graph Theory in Networks Lecture 4, 9/9/04 EE 228A, Fall 2004 Rajarshi Gupta University of California, Berkeley.
Mathematics of Networks (Cont)
Introduction to Graph Theory
Data Structures & Algorithms Graphs
Graph Colouring L09: Oct 10. This Lecture Graph coloring is another important problem in graph theory. It also has many applications, including the famous.
Agenda Review: –Planar Graphs Lecture Content:  Concepts of Trees  Spanning Trees  Binary Trees Exercise.
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
Trees Thm 2.1. (Cayley 1889) There are nn-2 different labeled trees
Graphs Lecture 2. Graphs (1) An undirected graph is a triple (V, E, Y), where V and E are finite sets and Y:E g{X V :| X |=2}. A directed graph or digraph.
1 EE5900 Advanced Embedded System For Smart Infrastructure Static Scheduling.
CSE 421 Algorithms Richard Anderson Winter 2009 Lecture 5.
Great Theoretical Ideas in Computer Science for Some.
COMPSCI 102 Introduction to Discrete Mathematics.
CSE 421 Algorithms Richard Anderson Autumn 2015 Lecture 5.
Trees.
Chapter 5 : Trees.
Graph theory Definitions Trees, cycles, directed graphs.
Great Theoretical Ideas in Computer Science
Advanced Algorithms Analysis and Design
Greedy Algorithms / Minimum Spanning Tree Yin Tat Lee
Graph Algorithms Using Depth First Search
Autumn 2016 Lecture 11 Minimum Spanning Trees (Part II)
Planarity Testing.
Discrete Mathematics for Computer Science
CSE 421: Introduction to Algorithms
Autumn 2015 Lecture 11 Minimum Spanning Trees (Part II)
CS 583 Analysis of Algorithms
Discrete Math II Howon Kim
Richard Anderson Autumn 2016 Lecture 5
Winter 2019 Lecture 11 Minimum Spanning Trees (Part II)
Autumn 2019 Lecture 11 Minimum Spanning Trees (Part II)
Presentation transcript:

Graph Theory in Networks Lecture 3, 9/7/04 EE 228A, Fall 2004 Rajarshi Gupta University of California, Berkeley

Rajarshi Gupta 2 Lecture 3, 9/7/04 EE 228A, Fall 2004 Plan for Graph Segment Lecture 2 – Thu (Sep 2, 2004) Paths and Routing Cycles and Protection Matching and Switching Lecture 3 – Tue (Sep 7, 2004) Coloring and Capacity Trees and Broadcast, Multicast Lecture 4 – Thu (Sep 9, 2004) Complete example: Capacity in Ad-Hoc Networks Lectures 8 & 9 – (Sep 23 & 28, 2004) Student Presentations (have you signed up ?)

Rajarshi Gupta 3 Lecture 3, 9/7/04 EE 228A, Fall 2004 Coloring: History Map coloring: Color all countries on a map using fewest colors Model: Each country is a node, edge if share boundary This forms a planar graph (edges don’t intersect)

Rajarshi Gupta 4 Lecture 3, 9/7/04 EE 228A, Fall & 5 Color Theorems Five color theorem: Every planar graph is 5-colorable Heawood, 1890 Four Color Theorem: Every planar graph is 4-colorable Conjectured for many years (since 1890) Proved by Appel and Haken (1977) Can do no better than 4 colors K 4 (complete graph in 4 vertices) is planar

Rajarshi Gupta 5 Lecture 3, 9/7/04 EE 228A, Fall Color Theorem (Lemma) Lemma: In a planar graph,  node w deg  5 Recall Euler’s Formula v- e+f=2 A planar graph with outside face = polyhedron Let d be avg node deg. So dv=2e r be avg face deg. So rf=2e Rewrite Euler But r  3, So Replacing e=dv/2, Hence For a finite graph, there must exist some node with degree < 6 f1f2 f3 f4v=4 e=6 f=4

Rajarshi Gupta 6 Lecture 3, 9/7/04 EE 228A, Fall Color Theorem Proof Induction: If v<6, trivial Assume true for v-1 vertices In G, remove node v with deg<6 Color rest of graph with 5 colors Can do this due to induction hypothesis Consider v Look at the 5 nodes around it If use < 4 colors, we are done

Rajarshi Gupta 7 Lecture 3, 9/7/04 EE 228A, Fall Color Theorem Proof (contd) Else look at induced subgraph only with colors red and blue If v1 and v3 not connected, interchange colors of v1- component s.t v1 is colored blue. And give red color to v. Else: v1-v-v2-v1 topologically separates v2 from v4 Now repeat the procedure for v2 and v4 There cannot be path from v2 to v4 (with colors green and pink) since graph is planar Hence can change color of v2

Rajarshi Gupta 8 Lecture 3, 9/7/04 EE 228A, Fall 2004 Chromatic Number Chromatic number Fewest number of colors required to color a graph Few common graphs K n is n-colorable Bipartite graphs are 2-colorable Planar graphs are 4-colorable

Rajarshi Gupta 9 Lecture 3, 9/7/04 EE 228A, Fall 2004 Theorem: Graph bi-colorable iff no odd cycles ‘  ’ Direction Proof by contradiction Assume odd cycle exists Color nodes on odd cycle as R, B, R, B … Eventually last node will have two neighbors with opposite colors ‘  ’ Direction Take any point v Make two sets V 1 and V 2 V 1 = nodes odd dist from v V 2 = nodes even dist frm v Claim: Every edge joins V 1 to V 2 Suppose line xy joins two nodes in same set Then cycle {v…x}+{xy}+{y…v} is odd {v…x} and {y…v} are both odd or both even By claim, color V 1 red and V 2 blue

Rajarshi Gupta 10 Lecture 3, 9/7/04 EE 228A, Fall 2004 Independent Sets (IS) Set of nodes that do not have an edge between them Set of nodes that can have the same color Maximal IS: not contained in any other IS Result: Number of maximal IS in a graph is exponential Graph coloring algorithms find IS Finding the chromatic number of a graph is NP-hard Many approximations exist

Rajarshi Gupta 11 Lecture 3, 9/7/04 EE 228A, Fall 2004 Approximate Coloring Greedy Algorithm Order nodes by degree Add first node to IS Discard all neighbors into a Future bin Repeat till set empty Start with future bin Correctness Are the sets generated independent ? Are they maximal ? Complexity Each iteration adds one node, so O(m) Discarding neighbors O(n) Total: O(mn) Followup: How far is this from optimal coloring Arbitrary or Bounded Many approx algos give coloring within 4X, 6X of optimal

Rajarshi Gupta 12 Lecture 3, 9/7/04 EE 228A, Fall 2004 Cliques Observe Each node in a clique needs a different color So    Clique is complement of IS Maximal Cliques: ABC, BCEF, CDF Definitions Clique = Complete Subgraph Maximal Clique = Clique not a subset of any other Clique Number  = size of largest clique  = 4

Rajarshi Gupta 13 Lecture 3, 9/7/04 EE 228A, Fall 2004 Perfect Graphs A graph is said to be perfect when its Chromatic Number  Clique Number  Are equal For all induced subgraphs Strong Perfect Graph Theorem Chudnovsky, Robertson, Seymour, Thomas (2002) A graph is perfect if and only if it has no odd holes or odd anti-holes Odd-hole is a odd cycle with no chord Odd anti-hole is complement of odd-hole

Rajarshi Gupta 14 Lecture 3, 9/7/04 EE 228A, Fall 2004 Duplication Lemma Lovasz (1972) Take a vertex v in G Add v’ s.t. v’ is neighbor to every neighbor of v If G is perfect, then G’ is perfect Proof Consider induced subgraph H’ of G’ If v’  H’, then  (H’)=  (H’) If v’  H’ but v  H’, then H’ isomorphic to corres. H If v,v’  H’ Consider H=H’\{v’} Since v and v’ are not connected, can give color of v to v’ (same neighbors) So  (H’)=  (H) Also  (H’)=  (H) Clique w/o v is not enlarged Clique with v is not enlarged as v and v’ not connected But  (H)=  (H) as G perfect Hence  (H’)=  (H’) and G’ is also perfect

Rajarshi Gupta 15 Lecture 3, 9/7/04 EE 228A, Fall 2004 Trees Define a tree G=(V,E) |V| = |E| + 1 Terminology Height of a tree Depth of a node In-degree Out-degree Leaves

Rajarshi Gupta 16 Lecture 3, 9/7/04 EE 228A, Fall 2004 Useful Trees Types of Trees Binary Tree Each non-leaf node has exactly 2 children Ternary Tree Height Balanced Tree Root chosen s.t. height is minimized Bipartite Graphs Induced Trees Formed by choosing a subset of V,E from G Rooted Tree Rooted at particular node Spanning Tree Covers every node ‘Subset Spanning Tree’ Covers every node in a chosen subset

Rajarshi Gupta 17 Lecture 3, 9/7/04 EE 228A, Fall 2004 Trees in Networks Broadcast Tree Search Trees BFS DFS Spanning Tree Protocol (STP) in Bridged Networks (e.g. Ethernet) Multicast Tree And many, many other places …

Rajarshi Gupta 18 Lecture 3, 9/7/04 EE 228A, Fall 2004 Trees and Ethernet Tree Feature Connected No cycles Removing any edge makes it disconnected Adding any edge forms a cycle Every pair of nodes has unique path Ethernet Behavior Need all LANs to talk Loops cause broadcast storms Any bridge/port failure needs recomputation Need to disable all redundant ports Guarantees path with STP

Rajarshi Gupta 19 Lecture 3, 9/7/04 EE 228A, Fall 2004 Concrete Example Weight balanced Spanning Tree (WBST) Each edge has cost e.g. 10/100/1000 Mbps Choose spanning tree that has min difference between min and max edge cost Want to minimize buffering requirements as packets move through the network. Also control jitter. Complexity

Rajarshi Gupta 20 Lecture 3, 9/7/04 EE 228A, Fall 2004 Recall Spanning Tree Algos Kruskal’s Greedy Algorithm to compute Spanning Tree 1. Order the edges in term of weight 2. Add lowest cost edge (provided no loops) 3. Check if all vertices is connected 4. If not, return to step 2 Any search (BFS/DFS) can check for connectedness BFS/DFS may be performed in O(m)

Rajarshi Gupta 21 Lecture 3, 9/7/04 EE 228A, Fall 2004 WBST : Algorithm Sort edges in increasing order of weight c 1 <c 2 <…<c m Initialize: diff = c m -c 1, low = 1, high = 1 Take G low,high = G (V, {c i : low  i  high}) if G low,high is connected if diff > (c high – c low ) diff := c high – c low Remember low, high low := low + 1 repeat else high := high + 1 repeat

Rajarshi Gupta 22 Lecture 3, 9/7/04 EE 228A, Fall 2004 WBST : Correctness Spanning Tree exists By checking G low,high is connected => spanning tree must exist Do this using DFS. Also finds the WBST Why balanced Keep adding low cost edges till graph connected Then try to discard as many low cost edges Move both ‘low’ and ‘high’ pointers to consider other ranges Remember best diff

Rajarshi Gupta 23 Lecture 3, 9/7/04 EE 228A, Fall 2004 WBST : Complexity In each iteration, we either increment low, or increment high So max number of iterations = 2m Each iteration needs to check connectedness: DFS O(m) So entire algo is O(m 2 ) Think: How would we make this algorithm distributed

Rajarshi Gupta 24 Lecture 3, 9/7/04 EE 228A, Fall 2004 Multicast Trees Application: Want to send packets from a source (e.g. internet radio station) to many hosts Sending n copies of the stream is wasteful Solution: Form tree rooted at source that spans all member nodes

Rajarshi Gupta 25 Lecture 3, 9/7/04 EE 228A, Fall 2004 Distributed Algorithm Need to know address of group First Join First member sends route request Request will be forwarded all the way to source Confirmation flows back to member All routers in path will add entry (mc_addr | port) Subsequent Join New member send route request Request forwarded to router that has mc_addr entry Send confirmation from this point on Augment route entry (mc_addr | port1, port2) Think: Optimal multicast tree

Rajarshi Gupta 26 Lecture 3, 9/7/04 EE 228A, Fall 2004 Multicast Algorithm (contd) Leave/Pruning Node leaving sends leave message to router Router removes port from route entry If last port entry deleted, send prune message to parent Multi-source multicast tree Less optimal: packets between two branches travel long distance But need to minimize state in routers

Rajarshi Gupta 27 Lecture 3, 9/7/04 EE 228A, Fall 2004 Lessons from this lecture Coloring Cliques Independent Sets Useful in capacity, scheduling Trees Bridged Networks Multicasting Used often when want to ensure unique path etc

Rajarshi Gupta 28 Lecture 3, 9/7/04 EE 228A, Fall 2004 Words of Wisdom (1) Graph Theory is an old field Konigsberg Bridge problem: Euler 1736 Lots of famous people 18 th and 19 th Century: Euler, Hamilton, Gauss 20 th Century: Erdos, Lovasz, Harary It is a very deep field. Takes years to get to cutting edge Replete in terminology – names for everything ! hole, cut, tree, forest, cycle, walk, degree, girth, face, cover, heredity, clique, independence, animal

Rajarshi Gupta 29 Lecture 3, 9/7/04 EE 228A, Fall 2004 Words of Wisdom (2) Searching for results in Graph Theory is tricky E.g. “Clique Algorithms” yielded nice list of referrences … 150 pages long !!! Need to have some understanding of Graph Theory to be able to utilize its results Take IEOR 266: Network Flows and Graphs