Graph problems Prof. Ramin Zabih

Slides:



Advertisements
Similar presentations
P, NP, NP-Complete Problems
Advertisements

Great Theoretical Ideas in Computer Science
Great Theoretical Ideas in Computer Science for Some.
Analysis of Algorithms CS 477/677
Graph algorithms Prof. Noah Snavely CS1114
22C:19 Discrete Math Graphs Fall 2010 Sukumar Ghosh.
22C:19 Discrete Math Graphs Fall 2014 Sukumar Ghosh.
Midwestern State University Department of Computer Science Dr. Ranette Halverson CMPS 2433 – CHAPTER 4 GRAPHS 1.
Graph-02.
Introduction to Graphs
CompSci 102 Discrete Math for Computer Science April 19, 2012 Prof. Rodger Lecture adapted from Bruce Maggs/Lecture developed at Carnegie Mellon, primarily.
1 NP-Complete Problems. 2 We discuss some hard problems:  how hard? (computational complexity)  what makes them hard?  any solutions? Definitions 
CSC 213 – Large Scale Programming. Today’s Goals  Examine new properties of DirectedGraph s  What reaching & reachable mean for a Graph  How humans.
Graphs Chapter 12. Chapter Objectives  To become familiar with graph terminology and the different types of graphs  To study a Graph ADT and different.
Great Theoretical Ideas in Computer Science.
1 Discrete Structures & Algorithms Graphs and Trees: II EECE 320.
1 Representing Graphs. 2 Adjacency Matrix Suppose we have a graph G with n nodes. The adjacency matrix is the n x n matrix A=[a ij ] with: a ij = 1 if.
Graph & BFS.
CS 410 Applied Algorithms Applied Algorithms Lecture #3 Data Structures.
Graph & BFS Lecture 22 COMP171 Fall Graph & BFS / Slide 2 Graphs * Extremely useful tool in modeling problems * Consist of: n Vertices n Edges D.
Graphs Chapter 12. Chapter 12: Graphs2 Chapter Objectives To become familiar with graph terminology and the different types of graphs To study a Graph.
Analysis of Algorithms CS 477/677
Connected Components, Directed Graphs, Topological Sort Lecture 25 COMP171 Fall 2006.
CS 1114: Graphs and Blobs Prof. Graeme Bailey (notes modified from Noah Snavely, Spring 2009)
Blobs and Graphs Prof. Noah Snavely CS1114
Polygons and the convex hull Prof. Noah Snavely CS1114
Connected Components, Directed graphs, Topological sort COMP171 Fall 2005.
W. D. Grover TRLabs & University of Alberta © Wayne D. Grover 2002, 2003 Graph theory and routing (initial background) E E Lecture 4.
CS/ENGRD 2110 Object-Oriented Programming and Data Structures Fall 2014 Doug James Lecture 17: Graphs.
Connected components and graph traversal Prof. Noah Snavely CS1114
22C:19 Discrete Math Graphs Spring 2014 Sukumar Ghosh.
Graph Coloring.
Chapter 9 – Graphs A graph G=(V,E) – vertices and edges
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett.
CSNB143 – Discrete Structure Topic 9 – Graph. Learning Outcomes Student should be able to identify graphs and its components. Students should know how.
CSE 326: Data Structures NP Completeness Ben Lerner Summer 2007.
CSE332: Data Abstractions Lecture 24.5: Interlude on Intractability Dan Grossman Spring 2012.
Medians and blobs Prof. Ramin Zabih
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.
NP-COMPLETE PROBLEMS. Admin  Two more assignments…  No office hours on tomorrow.
NP-Complete problems.
Discrete Mathematical Structures: Theory and Applications
Graphs A ‘Graph’ is a diagram that shows how things are connected together. It makes no attempt to draw actual paths or routes and scale is generally inconsequential.
Graph theory and networks. Basic definitions  A graph consists of points called vertices (or nodes) and lines called edges (or arcs). Each edge joins.
CSC2100B Tutorial 10 Graph Jianye Hao.
CSCI2100 Data Structures Tutorial 12
NPC.
Introduction to Graph Theory By: Arun Kumar (Asst. Professor) (Asst. Professor)
Great Theoretical Ideas in Computer Science for Some.
Graphs Definition: a graph is an abstract representation of a set of objects where some pairs of the objects are connected by links. The interconnected.
Graphs. Graph Definitions A graph G is denoted by G = (V, E) where  V is the set of vertices or nodes of the graph  E is the set of edges or arcs connecting.
COSC 3101A - Design and Analysis of Algorithms 14 NP-Completeness.
Week 11 - Wednesday.  What did we talk about last time?  Graphs  Paths and circuits.
Blobs and Graphs Prof. Noah Snavely CS1114
Graphs Lecture 19 CS2110 – Spring 2013.
Agenda Lecture Content: Introduction to Graph Path and Cycle
Great Theoretical Ideas in Computer Science
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett
Lecture 15: Graph Theory II
Shortest Paths.
CSE 373: Data Structures and Algorithms
A Introduction to Computing II Lecture 13: Trees
Mathematics for Computer Science MIT 6.042J/18.062J
Graphs G = (V, E) V are the vertices; E are the edges.
Shortest Paths.
Richard Anderson Lecture 5 Graph Theory
GRAPHS.
Chapter 14 Graphs © 2011 Pearson Addison-Wesley. All rights reserved.
Prof. Ramin Zabih Graph Traversal Prof. Ramin Zabih
Presentation transcript:

Graph problems Prof. Ramin Zabih

2 Administrivia  Assignment 2 is due Friday –Working Roomba’s are on the way (?)  Quiz 3 on Tuesday 9/25 –Coverage through next lecture  Optional lecture topics are ready –First one will be RDZ talking about graphs Graph questions are favorites for interviewers (at places like Google and Microsoft)

3 Some major graph problems  Graph coloring –Ensuring that radio stations don’t clash  Graph connectivity –How fragile is the internet?  Graph cycles –Helping FedEx/UPS/DHL plan a route  Planarity testing –Connecting computer chips on a motherboard  Graph isomorphism –Is a chemical structure already known?

4 How to represent graphs?  The adjacency matrix A is n by n –We will give each vertex a number 1..n –A(r,c) == 1 when there is an edge between vertex r and vertex c –Note that A(r,c) == A(c,r) V1 V2 V3 V4 V5

5  Given a graph and a set of colors {1..k}  We want to assign each vertex a color –Two adjacent vertices have different colors Graph coloring problem V1 V2 V3 V4 V5

6 Radio frequencies via coloring  Make a graph where a station is a vertex –Put an edge between two stations that clash I.e., if their signal areas overlap –Any coloring is a non-clashing layout Can you prove this? What about vice-versa? C1 C2 C3 C4 C5

7 Verifying vs. finding  One theme we’ve seen is that it can be easy to verify you have the right answer –I.e., prove that your candidate is the solution –Example: sorting  If this is easy, there is a dumb algorithm –Guess and verify –Or: try everything  It’s not always easy to verify that an answer is correct –Example: is this graph 4-colorable?

8 Graphs and paths  Can you get from vertex V to vertex W? –Is there a route from one city to another?  More precisely, is there a sequence of vertices {V,V 1,V 2,…,V k,W} such that every adjacent pair has an edge between them –This is called a path –A cycle is a path from V to V –A path is simple if no vertex appears twice

9 Graph connectivity  For any pair of nodes, is there a path between them? –Basic idea of the Internet: you can get from any computer to any other computer –This pair of nodes is called connected A set of nodes is connected if all pairs are –A graph is connected if all nodes are connected  Related question: if I remove an arbitrary node, is the graph still connected? –Is the Internet intact if any 1 computer fails?

10 Connected components  Even if all nodes are not connected, there will be subsets that are all connected –Connected components –All nodes are connected –Is this sufficient? Why not? V5 V4 V1 V3 V2

11 Blobs are components! A B C D EFG H A C B D F E H G