Lecture 11 - Graph - 4 slides per page

Lecture 11 - Graph - 4 slides per page - SARS and CS1102...

Info iconThis preview shows pages 1–9. Sign up to view the full content.

View Full Document Right Arrow Icon
1 Graphs NUS CS1102 2 SARS and CS1102 b Question : Given a population of N, how many rounds of infections is needed to infect all N people? b Answer : O(log N) NUS CS1102 3 Readings b Textbook s [Carrano] ch13 pg727-770 b Exercise s 1,2,3 NUS CS1102 4 Linked list
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
2 NUS CS1102 5 Tree NUS CS1102 6 Directed graph vertex (node) edge Tree: unique path Graph: multiple paths NUS CS1102 7 Example: travel planning shopping mall direct route 5 cost NUS CS1102 8 Weighted directed graph 5 3 -2 5 1 0
Background image of page 2
3 NUS CS1102 9 Undirected graph NUS CS1102 10 Complete graph O(n^2) NUS CS1102 11 Path a c d e b Path, length,simple path NUS CS1102 12 Cycle a c g d e b f Simple cycle
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
4 NUS CS1102 13 Disconnected graph Applications NUS CS1102 15 Travel Planning shopping mall direct route 5 cost NUS CS1102 16 Question b What is the shortest way to travel between A and B? SHORTEST PATH PROBLEM b How to minimize the cost of visiting n cities such that we visit each city exactly once, and finishing at the city where we start from? “TRAVELING SALESMAN PROBLEM (TSP)”
Background image of page 4
5 NUS CS1102 17 Internet computer network link NUS CS1102 19 Question b What is the shortest route to send a packet from A to B? SHORTEST PATH PROBLEM NUS CS1102 20 The Web web page web link
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
6 NUS CS1102 21 Question b Which web pages are important? b Which set of web pages are likely to be of the same topic? NUS CS1102 22 Module Selection module prerequisite NUS CS1102 23 Question b Find a sequence of modules to take that satisfy the prerequisite requirements. “TOPOLOGICAL SORT” NUS CS1102 24 Terrorist suspects knows
Background image of page 6
7 NUS CS1102 25 Question b Who are the important figures in a terrorist network? NUS CS1102 26 NUS CS1102 27 Epidemic Studies patient contact NUS CS1102 28 Other applications b Biology b VLSI layout b Vehicle routing b Job scheduling b Facility location : :
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
8 Implementation NUS CS1102 30 Formally A graph G = (V, E, w), where s V is the set of vertices s E is the set of edges s w is the weight function NUS CS1102 31 Example V = { a, b, c } E = { (a,b), (c,b), (a,c) } w = { ((a,b), 4), ((c, b), 1), ((a,c),-3) } a b c 4 1 -3 NUS CS1102 32 Adjacent vertices b adj(v) = set of vertices adjacent to v adj(a) = {b, c} adj(b) = {} adj(c) = {b} b v |adj(v)| = |E| b adj(v): Neighbours of v a b c 4 1 -3
Background image of page 8
Image of page 9
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 08/02/2009 for the course ECE CS1102C taught by Professor Dr.tansuntuck during the Spring '07 term at National University of Singapore.

Page1 / 25

Lecture 11 - Graph - 4 slides per page - SARS and CS1102...

This preview shows document pages 1 - 9. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online