Lecture outline. Graph coloring Examples Applications Algorithms

Similar documents
Lecture 6: Graph Properties

Chapter 16. Greedy Algorithms

Graph Coloring. Margaret M. Fleck. 3 May This lecture discusses the graph coloring problem (section 9.8 of Rosen).

Math 575 Exam 3. (t). What is the chromatic number of G?

How many colors are needed to color a map?

CSE 421 Applications of DFS(?) Topological sort

Artificial Intelligence

Vertex coloring, chromatic number

CSC 373: Algorithm Design and Analysis Lecture 3

Discrete mathematics

4.1 Interval Scheduling

Using Euler s Theorem

The Konigsberg Bridge Problem

Brief History. Graph Theory. What is a graph? Types of graphs Directed graph: a graph that has edges with specific directions

Class Six: Coloring Planar Graphs

Announcements. CSEP 521 Applied Algorithms. Announcements. Polynomial time efficiency. Definitions of efficiency 1/14/2013

Vertex coloring, chromatic number

MAT 145: PROBLEM SET 6

EE512 Graphical Models Fall 2009

Design and Analysis of Algorithms

Elements of Graph Theory

Math 3012 Applied Combinatorics Lecture 12

CSE 417 Network Flows (pt 4) Min Cost Flows

Greedy algorithms is another useful way for solving optimization problems.

HOMEWORK 4 SOLUTIONS. Solution: The Petersen graph contains a cycle of odd length as a subgraph. Hence,

Interval Graphs. Joyce C. Yang. Nicholas Pippenger, Advisor. Arthur T. Benjamin, Reader. Department of Mathematics

arxiv: v3 [cs.dm] 12 Jun 2014

Definition 1.1. A matching M in a graph G is called maximal if there is no matching M in G so that M M.

Graphs and Discrete Structures

1. The following graph is not Eulerian. Make it into an Eulerian graph by adding as few edges as possible.

Informed search algorithms. Chapter 4

Discrete Wiskunde II. Lecture 6: Planar Graphs

9 About Intersection Graphs

How many colors are needed to color a map?

Colouring graphs with no odd holes

Network flows and Menger s theorem

10. EXTENDING TRACTABILITY

Characterizations of graph classes by forbidden configurations

Graphs and trees come up everywhere. We can view the internet as a graph (in many ways) Web search views web pages as a graph

Grades 7 & 8, Math Circles 31 October/1/2 November, Graph Theory

2 hours THE UNIVERSITY OF MANCHESTER. 23 May :45 11:45

The Probabilistic Method

Graphs and Algorithms 2015

Math 443/543 Graph Theory Notes 5: Planar graphs and coloring

Approximation Algorithms

Lecture 20 : Trees DRAFT

CSC 373: Algorithm Design and Analysis Lecture 4

Graph theory. Po-Shen Loh. June We begin by collecting some basic facts which can be proved via bare-hands techniques.

2 hours THE UNIVERSITY OF MANCHESTER. 22 May :00 16:00

UCSD CSE 21, Spring 2014 [Section B00] Mathematics for Algorithm and System Analysis

6.006 Introduction to Algorithms. Lecture 25: Complexity Prof. Erik Demaine

Ma/CS 6a Class 9: Coloring

Small Survey on Perfect Graphs

Dr. Amotz Bar-Noy s Compendium of Algorithms Problems. Problems, Hints, and Solutions

A.I.: Informed Search Algorithms. Chapter III: Part Deux

Info 2950, Lecture 16

Scheduling, Map Coloring, and Graph Coloring

Majority and Friendship Paradoxes

COMP Online Algorithms. Online Graph Problems. Shahin Kamali. Lecture 23 - Nov. 28th, 2017 University of Manitoba

GRAPHS Lecture 17 CS2110 Spring 2014

Discrete mathematics II. - Graphs

Last week: Breadth-First Search

CS612 Algorithms for Electronic Design Automation

CS521 \ Notes for the Final Exam

Introduction to Graph Theory

Proposition 1. The edges of an even graph can be split (partitioned) into cycles, no two of which have an edge in common.

Bounds on graphs with high girth and high chromatic number

Chapter 6 GRAPH COLORING

10. EXTENDING TRACTABILITY

λ -Harmonious Graph Colouring

Lecture 24: More Reductions (1997) Steven Skiena. skiena

GRAPH THEORY: AN INTRODUCTION

Informed/Heuristic Search

Extremal Graph Theory. Ajit A. Diwan Department of Computer Science and Engineering, I. I. T. Bombay.

Maximum Differential Graph Coloring

Multiagent Graph Coloring: Pareto Efficiency, Fairness and Individual Rationality By Yaad Blum, Jeffrey S. Rosenchein

Informed search algorithms. Chapter 4

COMP260 Spring 2014 Notes: February 4th

Problem Set 3. MATH 776, Fall 2009, Mohr. November 30, 2009

Math 776 Graph Theory Lecture Note 1 Basic concepts

Graph Algorithms (part 3 of CSC 282),

APPROXIMATION ALGORITHMS FOR GEOMETRIC PROBLEMS

Chapter 3. Graphs CLRS Slides by Kevin Wayne. Copyright 2005 Pearson-Addison Wesley. All rights reserved.

Combinatorics Summary Sheet for Exam 1 Material 2019

The k-center problem Approximation Algorithms 2009 Petros Potikas

Description of grading scheme and advice for final exam (and HW, quizzes, etc).

Adjacent: Two distinct vertices u, v are adjacent if there is an edge with ends u, v. In this case we let uv denote such an edge.

Informed Search and Exploration for Agents

MAS341 Graph Theory 2015 exam solutions

Definition For vertices u, v V (G), the distance from u to v, denoted d(u, v), in G is the length of a shortest u, v-path. 1

Greedy Algorithms. Alexandra Stefan

Informed Search. Best-first search. Greedy best-first search. Intelligent Systems and HCI D7023E. Romania with step costs in km

(x 2)(3x + 1) = 3x + 1

Graph Algorithms (part 3 of CSC 282),

Graph Theory Part Two

Remarks on Kuratowski s Planarity Theorem. A planar graph is a graph that can be drawn in a plane without edges crossing one another.

Solutions to relevant spring 2000 exam problems

Simple Graph. General Graph

Graphs and Algorithms 2016

8 Matroid Intersection

Transcription:

Lecture outline Graph coloring Examples Applications Algorithms

Graph coloring Adjacent nodes must have different colors. How many colors do we need?

Graph coloring Neighbors must have different colors How many colors do we need?

Graph coloring Neighbors must have different colors Not valid

Definitions k-colorable: can be colored with k colors chromatic number: min number of colors needed

Cycle graph

Cycle graph Odd-length cycles require 3 colors

Cycle graph No way to color with only 2 colors

Bipartite graph

Bipartite graph Bipartite 2-colorable

Tree c a b c h e k g l d i f j b e d a g i h k l f j

Tree c a b c h e k g l d i f j b e d a g i h k l f j

Clique

Clique If G contains a Clique of size k, then it requires at least k colors

Planar graph

Planar graph exam-like question: draw the smallest planar graph with chromatic number 4

Planar graph coloring Some planar graphs require 4 colors Any planar graph is 5-colorable (1890) Can every planar graph be colored with 4 colors? (Stated in 1852, solved in 1976)

map coloring map coloring planar graph coloring

4 color theorem Every planar graph (and map) can be colored with 4 colors.

Graph coloring Examples Applications Register allocation Logistics problems Scheduling problems Puzzles Algorithms

Applications K 9 K 9

Applications

Sudoku 5 3 7 6 1 9 8 9 8 6 8 6 3 4 8 3 1 7 2 6 2 8 4 1 9 8 7 5 9

Register allocation Limited registers (16 in a x86-64 CPU) Goal: avoid storing local variables in main memory If a variable X is put in a register, other variables can t use that register until the last use of X Need to decide which variable goes to which register for (i=0; i<n; i++){... } for (j=0; j<n; j++){... } i and j can go in the same register, but i and n can t

Interval graph Nodes: intervals Edges: overlapping intervals

Register allocation same color = same register Source: scienceblogs.com/goodmath/2007/06/28/graph-coloring-algorithms-1/

Logistics problems Grouping things into as few groups as possible Nodes: things Edges: things that can t be together Each color is a group Examples: register allocation, chemical storage,...

Scheduling problems Doing a set of tasks in the shortest time Nodes: tasks Edges: tasks that can t be done at the same time Each color is a time slot Examples: exam scheduling,...

Graph coloring Examples Applications Algorithms Can this graph be colored with k colors? Find an optimal coloring Or suboptimal coloring more quickly

2-colorability Is a graph 2-colorable? (is a graph bipartite?) Run BFS Color nodes by level in the BFS tree If there are cross edges between same-parity levelss not 2-colorable BFS Tree edges Cross edges between even and odd Cross edges between same-parity levels

3-colorability Is a graph 3-colorable? different colorings with n nodes and 3 colors: 3 n or n 3? In general: n nodes and k colors k n different colorings Exponential! Next lecture: 3-colorability is NP-complete (even for planar graphs)

Greedy coloring Algorithm: 1. Consider the nodes in some order 2. Give each node in this order the first color not used by its neighbors Not optimal: depends on order 1 3 4 2 1 3 2 4 Order Coloring

Greedy coloring It can be really bad 1 5 1 2 2 6 3 4 3 7 5 6 4 8 7 8

k-regular graph How many colors are needed?

Greedy upper bound Algorithm: 1. Consider the nodes in some order 2. Give each node in this order the first color not used by its neighbors If the max degree of any node is r, the graph is (r + 1)-colorable Proof: let u be any node. When it s time to color u, even if all its neighbors are already colored, they can use at most r colors, so r + 1 colors suffice to color u.

k-regular graph Greedy coloring (k+1)-colorable

Greedy upper bound If the max degree of any node is r, the graph is (r + 1)-colorable Can still be a bad upper bound

Greedy for interval graphs Suppose the biggest clique has size k The chromatic number must be at least k If nodes are sorted by starting point, greedy coloring finds a k-coloring Therefore, it is optimal

Greedy for interval graphs If nodes are sorted by starting point, greedy coloring finds a k-coloring. Proof: 1. Let I = (I s, I e ) be any interval 2. Any neighbor of I must end after I s 3. Any already-colored neighbor of I must start before I s 4. (2. and 3.) I and the already-colored neighbors of I intersect at I s 5. If the max clique size is k, there are at most k 1 already-colored neighbors of I, and I can use color k

Overview Graph coloring Examples Bipartite graphs Cliques Planar graphs Applications Sudoku Register allocation Logistics problems Scheduling problems Algorithms Thanks! 2-coloring Greedy coloring