233-234233-234 Sedgewick & Wayne (2004); Chazelle (2005) Sedgewick & Wayne (2004); Chazelle (2005)

Slides:



Advertisements
Similar presentations
1 Undirected Breadth First Search F A BCG DE H 2 F A BCG DE H Queue: A get Undiscovered Fringe Finished Active 0 distance from A visit(A)
Advertisements

Breadth First Search AB F I EH DC G FIFO Queue - front.
Topological Sort Topological sort is the list of vertices in the reverse order of their finishing times (post-order) of the depth-first search. Topological.
ALGORITHMS THIRD YEAR BANHA UNIVERSITY FACULTY OF COMPUTERS AND INFORMATIC Lecture eight Dr. Hamdy M. Mousa.
More Graphs COL 106 Slides from Naveen. Some Terminology for Graph Search A vertex is white if it is undiscovered A vertex is gray if it has been discovered.
Graph A graph, G = (V, E), is a data structure where: V is a set of vertices (aka nodes) E is a set of edges We use graphs to represent relationships among.
Breadth-First Search Seminar – Networking Algorithms CS and EE Dept. Lulea University of Technology 27 Jan Mohammad Reza Akhavan.
Algorithms and Data Structures
1 Undirected Breadth First Search F A BCG DE H Source:
Zhengjin Graphs: Adjacency Matrix ● Example: a d bc A ?? 4.
Graph Searching (Graph Traversal) Algorithm Design and Analysis Week 8 Bibliography: [CLRS] – chap 22.2 –
1 Breadth First Search AB F I EH DC G FIFO Queue - front.
Breadth First Search
Data Structures & Algorithms Graph Search Richard Newman based on book by R. Sedgewick and slides by S. Sahni.
Sedgewick & Wayne (2004); Chazelle (2005) Sedgewick & Wayne (2004); Chazelle (2005)
Sedgewick & Wayne (2004); Chazelle (2005) Sedgewick & Wayne (2004); Chazelle (2005)
1 Undirected Depth First Search Adjacency Lists A: F C B G B: A C: A D: F E E: G F D F: A E D: G: E A: H: I: I: H: F A BCG DE HI.
1 Data Structures and Algorithms Graphs I: Representation and Search Gal A. Kaminka Computer Science Department.
Spring 2010CS 2251 Graphs Chapter 10. Spring 2010CS 2252 Chapter Objectives To become familiar with graph terminology and the different types of graphs.
CSE 780 Algorithms Advanced Algorithms Graph Algorithms Representations BFS.
Sedgewick & Wayne (2004); Chazelle (2005) Sedgewick & Wayne (2004); Chazelle (2005)
Complexity 1 Mazes And Random Walks. Complexity 2 Can You Solve This Maze?
Breadth First Search (BFS) Part 2 COMP171. Graph / Slide 2 Shortest Path Recording * BFS we saw only tells us whether a path exists from source s, to.
Graphs & Graph Algorithms Nelson Padua-Perez Bill Pugh Department of Computer Science University of Maryland, College Park.
CISC220 Fall 2009 James Atlas Nov 13: Graphs, Line Intersections.
Lecture 13 CSE 331 Oct 2, Announcements Mid term in < 2 weeks Graded HW2 at the END of the class.
Sedgewick & Wayne (2004); Chazelle (2005) Sedgewick & Wayne (2004); Chazelle (2005)
Busby, Dodge, Fleming, and Negrusa. Backtracking Algorithm Is used to solve problems for which a sequence of objects is to be selected from a set such.
Stefano Boccaletti Complex networks in science and society *Istituto Nazionale di Ottica Applicata - Largo E. Fermi, Florence, ITALY *CNR-Istituto.
DATA MINING LECTURE 13 Pagerank, Absorbing Random Walks Coverage Problems.
Common final examinations When: Wednesday, 12/11, 3:30-5:30 PM Where: Ritter Hall - Walk Auditorium 131 CIS 1166 final When: Wednesday, 12/11, 5:45-7:45.
Douglas Wilhelm Harder, M.Math. LEL Department of Electrical and Computer Engineering University of Waterloo Waterloo, Ontario, Canada ece.uwaterloo.ca.
Analysis of Algorithms CS 477/677 Instructor: Monica Nicolescu Lecture 20.
Trees Thm 2.1. (Cayley 1889) There are nn-2 different labeled trees
Graphs & Paths Presentation : Part II. Graph representation Given graph G = (V, E). May be either directed or undirected. Two common ways to represent.
1 Distributed Vertex Coloring. 2 Vertex Coloring: each vertex is assigned a color.
CSC317 1 At the same time: Breadth-first search tree: If node v is discovered after u then edge uv is added to the tree. We say that u is a predecessor.
Representing Graphs Depth First Search Breadth First Search Graph Searching Algorithms.
Data Structures and Algorithm Analysis Lecture 5
Graphs – Breadth First Search
Random Walk for Similarity Testing in Complex Networks
Minimum Spanning Trees
Spanning Trees.
CSC317 Graph algorithms Why bother?
Graph Search Lecture 17 CS 2110 Fall 2017.
Lecture 12 Graph Algorithms
Ellen Walker CPSC 201 Data Structures Hiram College
CSE 421: Introduction to Algorithms
Finding Shortest Paths
Advanced Algorithms Analysis and Design
Breadth-First Search The Breadth-first search algorithm
Breadth First Search 11/21/ s
Chapter 22: Elementary Graph Algorithms I
SWBAT: Review sampling distributions of sample proportions and means
Graphs Part 2 Adjacency Matrix
CSE 421: Introduction to Algorithms
Undirected Depth First Search
COMP171 Depth-First Search.
Breadth First Search - A B C D E F G H I front FIFO Queue.
Breadth First Search s
Depth-First Search CSE 2011 Winter April 2019.
Breadth-First Search L0 L1 L2 C B A E D F Breadth-First Search
Lecture 12 CSE 331 Sep 22, 2014.
Graph Traversal Lecture 18 CS 2110 — Spring 2019.
Data structure for graph algorithms: Adjacent list, Adjacent matrix
Clustering.
Breadth First Search s
Undirected Depth First Search
Presentation transcript:

Sedgewick & Wayne (2004); Chazelle (2005) Sedgewick & Wayne (2004); Chazelle (2005)

Adjacency lists

1. Birds eat the bread crumbs 2. They don’t random walk DFS/BFS Hansel & Gretel

Diffusion equation

Normal distribution Random walk

With bread crumbs one can find exit in time proportional to V+E DFS/BFS Hansel & Gretel

Breadth First Search

F A BCG DE H

F A BCG DE H Queue: A get 0 distance from A visit(A)

Breadth First Search F A BCG DE H Queue: 0 F 1 F discovered

Breadth First Search F A BCG DE H Queue: F 0 1 B 1 B discovered

Breadth First Search F A BCG DE H Queue: F B C 1 C discovered

Breadth First Search F A BCG DE H Queue: F B C G 1 G discovered

Breadth First Search F A BCG DE H Queue: F B C G get A finished

Breadth First Search F A BCG DE H Queue: B C G A already visited

Breadth First Search F A BCG DE H Queue: B C G D 2 D discovered

Breadth First Search F A BCG DE H Queue: B C G D E 2 E discovered

Breadth First Search F A BCG DE H Queue: B C G D E get F finished

Breadth First Search F A BCG DE H Queue: C G D E

Breadth First Search F A BCG DE H Queue: C G D E A already visited

Breadth First Search F A BCG DE H Queue: C G D E get B finished

Breadth First Search F A BCG DE H Queue: G D E A already visited

Breadth First Search F A BCG DE H Queue: G D E get C finished

Breadth First Search F A BCG DE H Queue: D E A already visited

Breadth First Search F A BCG DE H Queue: D E E already visited

Breadth First Search F A BCG DE H Queue: D E get G finished

Breadth First Search F A BCG DE H Queue: E E already visited

Breadth First Search F A BCG DE H Queue: E F already visited

Breadth First Search F A BCG DE H Queue: E get D finished

Breadth First Search F A BCG DE H Queue: D already visited

Breadth First Search F A BCG DE H Queue: F already visited

Breadth First Search F A BCG DE H Queue: G already visited

Breadth First Search F A BCG DE H Queue: H 3 H discovered

Breadth First Search F A BCG DE Queue: H get H 3 E finished

Breadth First Search F A BCG DE H Queue: E already visited

Breadth First Search F A BCG DE H Queue: STOP H finished

Breadth First Search F A BCG DE H distance from A

Breadth-First Search

b c a d a c d b v

Rod Steiger Martin Sheen Donald Pleasence #1 #2 #3 #876 Kevin Bacon Barabasi

Why Kevin Bacon? Measure the average distance between Kevin Bacon and all other actors. 876 Kevin Bacon Barabasi

Langston et al., A combinatorial approach to the analysis of differential gene expression data…. Minimum Dominating Set

size of dominating set

Expected size of dominating set Assume each node has at least d neighbors Naïve algorithm still n/2 in worst case Simple probabilistic algorithm:

1. For each vertex v, color v red with probability p

2. Color blue any non-dominated vertex

X= number of red nodes Y= number of blue nodes Size of dominating set = X+Y

Expected size of dominating set S =

Markov’s inequality proof j= k E|S|

Probability that is < 1/2 Run algorithm 10 times and keep smallest S with probability > 0.999