Problem: Large Graphs

Size: px
Start display at page:

Download "Problem: Large Graphs"

Transcription

1 S : ata Structures raph lgorithms raph Search Lecture Problem: Large raphs It is expensive to find optimal paths in large graphs, using S or ijkstra s algorithm (for weighted graphs) How can we search large graphs efficiently by using commonsense about which direction looks most promising? xample xample 5 nd St 5 nd St 5 nd St 5 nd St 5 st St 5 st St 5 th St S 5 th St S nd ve rd ve th ve 5 th ve th ve 7 th ve 8 th ve 9 th ve th ve nd ve rd ve th ve 5 th ve th ve 7 th ve 8 th ve 9 th ve th ve Plan a route from 9 th & 5 th to rd & 5 st Plan a route from 9 th & 5 th to rd & 5 st est irst Search est irst Search The Manhattan distance (Δ x+ Δ y) is an estimate of the distance to the goal It is a search heuristic est irst Search Order nodes in priority to minimize estimated distance to the goal ompare: S / ijkstra Order nodes in priority to minimize distance from the start Open Heap (priority queue) riteria Smallest key (highest priority) h(n) heuristic estimate of distance from n to closest goal est_irst_search( Start, oal_test) insert(start, h(start), heap); repeat if (empty(heap)) then return fail; Node := deletemin(heap); if (oal_test(node)) then return Node; for each hild of node do if (hild not already visited) then insert(hild, h(hild),heap); end Mark Node as visited; end 5

2 Obstacles est S eventually will expand vertex to get back on the right track 5 nd St 5 nd St Non Optimality of est irst Path found by est-first 5 nd St S 5 st St S 5 st St 5 th St 5 th St th ve 9 th ve 8 th ve 7 th ve th ve 5 th ve th ve rd ve nd ve th ve 9 th ve 8 th ve 7 th ve th ve Shortest Path 5 th ve th ve rd ve nd ve 7 8 Improving est irst est first is often tremendously faster than S/ijkstra, but might stop with a non optimal solution How can it be modified to be (almost) as fast, but guaranteed to find optimal solutions? * Hart, Nilsson, Raphael 98 One of the first significant algorithms developed in I Widely used in many applications * xactly like est first search, but using a different criteria for the priority queue: minimize (distance from start) + (estimated distance to goal) priority f(n) = g(n) + h(n) f(n) = priority of a node g(n) = true distance from start h(n) = heuristic distance to goal 9 Optimality of * * in ction Suppose the estimated distance is always less than or equal to the true distance to the goal heuristic is a lower bound 5 nd St 5 nd St 5 st St S h=+ h=7+ Then: when the goal is removed from the priority queue, we are guaranteed to have found a shortest path! 5 th St H=+7 th ve 9 th ve 8 th ve 7 th ve th ve 5 th ve th ve rd ve nd ve

3 pplication of *: Speech Recognition (Simplified) Problem: System hears a sequence of words It is unsure about what it heard or each word, it has a set of possible guesses.g.: Word is one of { hi, high, I } What is the most likely sentence it heard? Speech Recognition as Shortest Path onvert to a shortest path problem: Utterance is a layered egins with a special dummy start node Next: layer of nodes for each word position, one node for each word choice dges between every node in layer i to every node in layer i+ ost of an edge is smaller if the pair of words frequently occur together in real speech Technically: log probability of co occurrence inally: a dummy end node ind shortest path from start to end node W W W Summary: raph Search W W W W W W W epth irst Little memory required Might find non optimal path readth irst Much memory required lways finds optimal path Iterative epth irst Search Repeated depth first searches, little memory required ijskstra s Short Path lgorithm Like S for weighted graphs est irst an visit fewer nodes Might find non optimal path * an visit fewer nodes than S or ijkstra Optimal if heuristic estimate is a lower bound 5 ynamic Programming lgorithmic technique that systematically records the answers to sub problems in a table and re uses those recorded results (rather than re computing them). loyd Warshall for (int k = ; k =< V; k++) for (int i = ; i =< V; i++) for (int j = ; j =< V; j++) if ( ( M[i][k]+ M[k][j] ) < M[i][j] ) M[i][j] = M[i][k]+ M[k][j] Simple xample: alculating the Nth ibonacci number. ib(n) = ib(n ) + ib(n ) Invariant: fter the kth iteration, the matrix includes the shortest paths for all pairs of vertices (i,j) containing only vertices..k as intermediate vertices 7 8

4 Initial state of the matrix: a b c d e a b - - c d e M[i][j] = min(m[i][j], M[i][k]+ M[k][j]) - a d b e - c 9 loyd-warshall - for ll-pairs shortest path a b c d e a - b c d e a d b e inal Matrix ontents - c Network lows S : ata Structures Network low iven a weighted, directed graph =(V,) Treat the edge weights as capacities How much can we flow through the graph? 7 H 9 5 I Network flow: definitions Network flow: definitions efine special source s and sink t vertices efine a flow as a function on edges: apacity: f(v,w) <= c(v,w) onservation: f ( u, v) = for all u v V except source, sink Value of a flow: f = f ( s, v) v Saturated edge: when f(v,w) = c(v,w) apacity: you can t overload an edge onservation: low entering any vertex must equal flow leaving that vertex We want to maximize the value of a flow, subject to the above constraints

5 Network lows iven a weighted, directed graph =(V,) Treat the edge weights as capacities How much can we flow through the graph? s H t 5 ood Idea that oesn t Work Start flow at While there s room for more flow, push more flow across the network! While there s some path from s to t, none of whose edges are saturated Push more flow along the path until some edge is saturated alled an augmenting path How do we know there s still room? xample () onstruct a residual graph: Same vertices dge weights are the leftover capacity on the edges If there is a path s t at all, then there is still room Initial graph no flow low / apacity 7 8 Include the residual capacities xample () xample () ugment along by unit (which saturates ) / / / / / / / / / / / / / / / / low / apacity Residual apacity 9 low / apacity Residual apacity

6 / / low / apacity Residual apacity xample () ugment along (which saturates and ) / / / / / / Now what? There s more capacity in the network but there s no more augmenting paths Network flow: definitions Network flow: definitions efine special source s and sink t vertices efine a flow as a function on edges: apacity: f(v,w) <= c(v,w) Skew symmetry: f(v,w) = f(w,v) onservation: f ( u, v) = for all u v V except source, sink Value of a flow: f = f ( s, v) v Saturated edge: when f(v,w) = c(v,w) apacity: you can t overload an edge Skew symmetry: sending f from u v implies you re sending f, or you could return f from v u onservation: low entering any vertex must equal flow leaving that vertex We want to maximize the value of a flow, subject to the above constraints Main idea: ord ulkerson method Start flow at While there s room for more flow, push more flow across the network! While there s some path from s to t, none of whose edges are saturated Push more flow along the path until some edge is saturated alled an augmenting path How do we know there s still room? onstruct a residual graph: Same vertices dge weights are the leftover capacity on the edges dd extra edges for backwards capacity too! If there is a path s t at all, then there is still room 5

7 xample (5) dd the backwards edges, to show we can undo some flow xample () ugment along (which saturates and, and empties ) / / low / apacity Residual apacity ackwards flow / / / / / / 7 / / low / apacity Residual apacity ackwards flow / / / / / / 8 xample (7) How should we pick paths? inal, maximum flow / / / Two very good heuristics (dmonds Karp): Pick the largest capacity path available Otherwise, you ll just come back to it later so may as well pick it up now / low / apacity Residual apacity ackwards flow / / / / 9 Pick the shortest augmenting path available or a good example why on t Mess this One Up Running time? / / / / / ach augmenting path can t get shorter and it can t always stay the same length So we have at most O() augmenting paths to compute for each possible length, and there are only O(V) possible lengths. ach path takes O() time to compute ugment along, then, then, then Total time = O( V) Should just augment along, and, and be finished

8 Network lows What about multiple sources? Network lows reate a single source, with infinite capacity edges connected to sources Same idea for multiple sinks s 7 H s 7 H s 9 5 t s! 9 s 5 t One more definition on flows We can talk about the flow from a set of vertices to another set, instead of just from one vertex to another: f ( X, Y ) = f ( x, y) x X y Y Should be clear that f(x,x) = So the only thing that counts is flow between the two sets Network cuts Intuitively, a cut separates a graph into two disconnected pieces ormally, a cut is a pair of sets (S, T), such that V = S T S T = {} and S and T are connected subgraphs of 5 Minimum cuts Min ut xample (8) If we cut into (S, T), where S contains the source s and T contains the sink t, S T Of all the cuts (S, T) we could find, what is the smallest (max) flow f(s, T) we will find? 7 apacity of cut = 5 8

9 oincidence? raphut NO! Max flow always equals Min cut Why? If there is a cut with capacity equal to the flow, then we have a maxflow: We can t have a flow that s bigger than the capacity cutting the graph! So any cut puts a bound on the maxflow, and if we have an equality, then we must have a maximum flow. If we have a maxflow, then there are no augmenting paths left Or else we could augment the flow along that path, which would yield a higher total flow. If there are no augmenting paths, we have a cut of capacity equal to the maxflow Pick a cut (S,T) where S contains all vertices reachable in the residual graph from s, and T is everything else. Then every edge from S to T must be saturated (or else there would be a path in the residual graph). So c(s,t) = f(s,t) = f(s,t) = f and we re done oding S : ata Structures ictionaries for ata ompression oes not use statistical knowledge of data. ncoder: s the input is processed develop a dictionary and transmit the index of strings found in the dictionary. ecoder: s the code is processed reconstruct the dictionary to invert the process of encoding. xamples: LZW, LZ77, Sequitur, pplications: Unix ompress, gzip, I 5 5 LZW ncoding lgorithm LZW ncoding xample () Repeat find the longest match w in the dictionary output the index of w put wa in the dictionary where a was the unmatched symbol b a b a b a b a b a 5 5

10 LZW ncoding xample () LZW ncoding xample () b ab a b a b a b a b a b ab ba a b a b a b a b a 55 5 LZW ncoding xample () LZW ncoding xample (5) b ab ba aba a b a b a b a b a b ab ba aba 5 abab a b a b a b a b a LZW ncoding xample () b ab ba aba 5 abab a b a b a b a b a LZW ecoding lgorithm mulate the encoder in building the dictionary. ecoder is slightly behind the encoder. initialize dictionary; decode first index to w; put w? in dictionary; repeat decode the first symbol s of the index; complete the previous dictionary entry with s; finish decoding the remainder of the index; put w? in the dictionary where w was just decoded; 59

11 LZW ecoding xample () LZW ecoding xample (a) b a? a b ab a b LZW ecoding xample (b) LZW ecoding xample (a) b ab b? a b b ab ba a b a LZW ecoding xample (b) LZW ecoding xample (a) b ab ba ab? a b ab b ab ba aba a b ab a 5

12 LZW ecoding xample (b) LZW ecoding xample (5a) b ab ba aba 5 aba? a b ab aba b ab ba aba 5 abab a b ab aba b 7 8 LZW ecoding xample (5b) LZW ecoding xample (a) b ab ba aba 5 abab ba? a b ab aba ba b ab ba aba 5 abab bab a b ab aba ba b 9 7 LZW ecoding xample (b) ecoding xercise b ab ba aba 5 abab bab 7 bab? a b ab aba ba bab ase b c d r

13 ounded Size ounded Size n bits of index allows a dictionary of size n oubtful that long entries in the dictionary will be useful. Strategies when the dictionary reaches its limit.. on t add more, just use what is there.. Throw it away and start a new dictionary.. ouble the dictionary, adding one more bit to indices.. Throw out the least recently visited entry to make room for the new entry. Notes on LZW xtremely effective when there are repeated patterns in the data that are widely spread. Negative: reates entries in the dictionary that may never be used. pplications: Unix compress, I, V. bis modem standard 7 7 LZ77 Ziv and Lempel, 977 is implicit Use the string coded so far as a dictionary. iven that x x...x n has been coded we want to code x n+ x n+...x n+k for the largest k possible. Solution If x n+ x n+...x n+k is a substring of x x...x n then x n+ x n+...x n+k can be coded by <j,k> where j is the beginning of the match. xample ababababa babababababababab... coded ababababa babababa babababab... <,8> 75 7 Solution Problem Solution What if there is no match at all in the dictionary? ababababa cabababababababab... coded Solution. Send tuples <j,k,x> where If k = then x is the unmatched symbol If k > then the match starts at j and is k long and the unmatched symbol is x. If x n+ x n+...x n+k is a substring of x x...x n and x n+ x n+... x n+k x n+k+ is not then x n+ x n+...x n+k x n+k+ can be coded by <j,k, x n+k+ > where j is the beginning of the match. xamples ababababa cabababababababab... ababababa c ababababab ababab... <,,c> <,9,b> 77 78

14 Solution xample a bababababababababababab... <,,a> a b ababababababababababab... <,,b> a b aba bababababababababab... <,,a> a b aba babab ababababababab... <,,b> a b aba babab abababababa bab... <,,a> Surprise ode! a bababababababababababab$ <,,a> a b ababababababababababab$ <,,b> a b ababababababababababab$ <,,$> 79 8 Surprise ecoding <,,a><,,b><,,$> <,,a> a <,,b> b <,,$> a <,,$> b <,,$> a <,9,$> b... <,,$> b <,,$> $ Surprise ecoding <,,a><,,b><,,$> <,,a> a <,,b> b <,,$> a <,,$> b <,,$> a <,9,$> b... <,,$> b <,,$> $ 8 8 Solution The matching string can include part of itself! If x n+ x n+...x n+k is a substring of x x...x n x n+ x n+...x n+k that begins at j < n and x n+ x n+... x n+k x n+k+ is not then x n+ x n+...x n+k x n+k+ can be coded by <j,k, x n+k+ > ounded uffer Sliding Window We want the triples <j,k,x> to be of bounded size. To achieve this we use bounded buffers. Search buffer of size s is the symbols x n s+...x n j is then the offset into the buffer. Look ahead buffer of size t is the symbols x n+...x n+t Match pointer can start in search buffer and go into the look ahead buffer but no farther. match pointer Sliding window aaaabababaaab$ search buffer coded uncoded text pointer look-ahead buffer uncoded tuple <,5,a> 8 8

Luke. Leia 2. Han Leia

Luke. Leia 2. Han Leia Reading SE : ata Structures raph lgorithms raph Search hapter.,.,. Lecture raph T raphs are a formalism for representing relationships between objects a graph is represented as = (V, E) Han V is a set

More information

CSE 326: Data Structures Dijkstra s Algorithm. James Fogarty Autumn 2007

CSE 326: Data Structures Dijkstra s Algorithm. James Fogarty Autumn 2007 SE 6: Data Structures Dijkstra s lgorithm James Fogarty utumn 007 Dijkstra, Edsger Wybe Legendary figure in computer science; was a professor at University of Texas. Supported teaching introductory computer

More information

Undirected graph is a special case of a directed graph, with symmetric edges

Undirected graph is a special case of a directed graph, with symmetric edges S-6S- ijkstra s lgorithm -: omputing iven a directed weighted graph (all weights non-negative) and two vertices x and y, find the least-cost path from x to y in. Undirected graph is a special case of a

More information

CS 5114: Theory of Algorithms. Graph Algorithms. A Tree Proof. Graph Traversals. Clifford A. Shaffer. Spring 2014

CS 5114: Theory of Algorithms. Graph Algorithms. A Tree Proof. Graph Traversals. Clifford A. Shaffer. Spring 2014 epartment of omputer Science Virginia Tech lacksburg, Virginia opyright c 04 by lifford. Shaffer : Theory of lgorithms Title page : Theory of lgorithms lifford. Shaffer Spring 04 lifford. Shaffer epartment

More information

Undirected graph is a special case of a directed graph, with symmetric edges

Undirected graph is a special case of a directed graph, with symmetric edges ijkstra s lgorithm 7-: omputing iven a directed weighted graph(all weights non-negative) and two verticesxand y, find the least-cost path fromxtoy in. Undirected graph is a special case of a directed graph,

More information

Shortest Paths and Minimum Spanning Trees

Shortest Paths and Minimum Spanning Trees /9/ hortest Paths and Minimum panning Trees dmin avid Kauchak cs0 pring 0 ijkstra s algorithm What about ijkstra s on? 0-0 /9/ What about ijkstra s on? ijkstra s algorithm only works for positive edge

More information

Shortest Paths and Minimum Spanning Trees

Shortest Paths and Minimum Spanning Trees // hortest Paths and Minimum panning Trees avid Kauchak cs pring dmin an resubmit homeworks - for up to half credit back l ue by the end of the week Read book // // // // // Is ijkstra s algorithm correct?

More information

An Efficient Algorithm for Identifying the Most Contributory Substring. Ben Stephenson Department of Computer Science University of Western Ontario

An Efficient Algorithm for Identifying the Most Contributory Substring. Ben Stephenson Department of Computer Science University of Western Ontario An Efficient Algorithm for Identifying the Most Contributory Substring Ben Stephenson Department of Computer Science University of Western Ontario Problem Definition Related Problems Applications Algorithm

More information

Spanning Trees. CSE373: Data Structures & Algorithms Lecture 17: Minimum Spanning Trees. Motivation. Observations. Spanning tree via DFS

Spanning Trees. CSE373: Data Structures & Algorithms Lecture 17: Minimum Spanning Trees. Motivation. Observations. Spanning tree via DFS Spanning Trees S: ata Structures & lgorithms Lecture : Minimum Spanning Trees simple problem: iven a connected undirected graph =(V,), find a minimal subset of edges such that is still connected graph

More information

Agenda. Graph Representation DFS BFS Dijkstra A* Search Bellman-Ford Floyd-Warshall Iterative? Non-iterative? MST Flow Edmond-Karp

Agenda. Graph Representation DFS BFS Dijkstra A* Search Bellman-Ford Floyd-Warshall Iterative? Non-iterative? MST Flow Edmond-Karp Graph Charles Lin genda Graph Representation FS BFS ijkstra * Search Bellman-Ford Floyd-Warshall Iterative? Non-iterative? MST Flow Edmond-Karp Graph Representation djacency Matrix bool way[100][100];

More information

Spanning Tree. Lecture19: Graph III. Minimum Spanning Tree (MSP)

Spanning Tree. Lecture19: Graph III. Minimum Spanning Tree (MSP) Spanning Tree (015) Lecture1: Graph III ohyung Han S, POSTH bhhan@postech.ac.kr efinition and property Subgraph that contains all vertices of the original graph and is a tree Often, a graph has many different

More information

1/19/2010. Usually for static, deterministic environment

1/19/2010. Usually for static, deterministic environment To download the discussion slides, go to http://april.eecs.umich.edu/courses/eecs492_w10/wiki/index.php/iscussion_lides eterministic, tochastic and trategic nvironment eterministic ompletely predictable

More information

COMP 8620 Advanced Topics in AI

COMP 8620 Advanced Topics in AI OMP 8620 dvanced Topics in Lecturers: Philip Kilby & Jinbo uang 25/07/2008 1 Part 1: Search Lecturer: r Philip Kilby Philip.Kilby@nicta.com.au Weeks 1-71 (Week 7 is assignment seminars) Part 2: Probabilistic

More information

CS 5114: Theory of Algorithms. Graph Algorithms. A Tree Proof. Graph Traversals. Clifford A. Shaffer. Spring 2014

CS 5114: Theory of Algorithms. Graph Algorithms. A Tree Proof. Graph Traversals. Clifford A. Shaffer. Spring 2014 epartment of omputer Science Virginia Tech lacksburg, Virginia opyright c 04 by lifford. Shaffer : Theory of lgorithms Title page : Theory of lgorithms lifford. Shaffer Spring 04 lifford. Shaffer epartment

More information

TCOM 501: Networking Theory & Fundamentals. Lecture 11 April 16, 2003 Prof. Yannis A. Korilis

TCOM 501: Networking Theory & Fundamentals. Lecture 11 April 16, 2003 Prof. Yannis A. Korilis TOM 50: Networking Theory & undamentals Lecture pril 6, 2003 Prof. Yannis. Korilis 2 Topics Routing in ata Network Graph Representation of a Network Undirected Graphs Spanning Trees and Minimum Weight

More information

Minimum Spanning Trees and Shortest Paths

Minimum Spanning Trees and Shortest Paths Minimum Spanning Trees and Shortest Paths Kruskal's lgorithm Prim's lgorithm Shortest Paths pril 04, 018 inda eeren / eoffrey Tien 1 Kruskal's algorithm ata types for implementation Kruskalslgorithm()

More information

Lecture 13: Weighted Shortest Paths. These slides include material originally prepared by Dr. Ron Cytron and Dr. Steve Cole.

Lecture 13: Weighted Shortest Paths. These slides include material originally prepared by Dr. Ron Cytron and Dr. Steve Cole. Lecture : Weighted Shortest Paths These slides include material originally prepared by r. Ron ytron and r. Steve ole. nnouncements Lab code and post-lab due tonight Lab released tomorrow ijkstra s algorithm

More information

Minimum Spanning Trees and Shortest Paths

Minimum Spanning Trees and Shortest Paths Minimum Spanning Trees and Shortest Paths Prim's algorithm ijkstra's algorithm November, 017 inda eeren / eoffrey Tien 1 Recall: S spanning tree Starting from vertex 16 9 1 6 10 13 4 3 17 5 11 7 16 13

More information

Lesson 4.2. Critical Paths

Lesson 4.2. Critical Paths Lesson. ritical Paths It is relatively easy to find the shortest time needed to complete a project if the project consists of only a few activities. ut as the tasks increase in number, the problem becomes

More information

mywbut.com Uninformed Search

mywbut.com Uninformed Search Uninformed Search 1 2.4 Search Searching through a state space involves the following: set of states Operators and their costs Start state test to check for goal state We will now outline the basic search

More information

Bayesian Networks and Decision Graphs

Bayesian Networks and Decision Graphs ayesian Networks and ecision raphs hapter 7 hapter 7 p. 1/27 Learning the structure of a ayesian network We have: complete database of cases over a set of variables. We want: ayesian network structure

More information

CS 493: Algorithms for Massive Data Sets Dictionary-based compression February 14, 2002 Scribe: Tony Wirth LZ77

CS 493: Algorithms for Massive Data Sets Dictionary-based compression February 14, 2002 Scribe: Tony Wirth LZ77 CS 493: Algorithms for Massive Data Sets February 14, 2002 Dictionary-based compression Scribe: Tony Wirth This lecture will explore two adaptive dictionary compression schemes: LZ77 and LZ78. We use the

More information

CS1800: Graph Algorithms (2nd Part) Professor Kevin Gold

CS1800: Graph Algorithms (2nd Part) Professor Kevin Gold S1800: raph lgorithms (2nd Part) Professor Kevin old Summary So ar readth-irst Search (S) and epth-irst Search (S) are two efficient algorithms for finding paths on graphs. S also finds the shortest path.

More information

CAD Algorithms. Shortest Path

CAD Algorithms. Shortest Path lgorithms Shortest Path lgorithms Mohammad Tehranipoor epartment September 00 Shortest Path Problem: ind the best way of getting from s to t where s and t are vertices in a graph. est: Min (sum of the

More information

Introduction to Graphs. common/notes/ppt/

Introduction to Graphs.   common/notes/ppt/ Introduction to Graphs http://people.cs.clemson.edu/~pargas/courses/cs212/ common/notes/ppt/ Introduction Graphs are a generalization of trees Nodes or verticies Edges or arcs Two kinds of graphs irected

More information

SIGNAL COMPRESSION Lecture Lempel-Ziv Coding

SIGNAL COMPRESSION Lecture Lempel-Ziv Coding SIGNAL COMPRESSION Lecture 5 11.9.2007 Lempel-Ziv Coding Dictionary methods Ziv-Lempel 77 The gzip variant of Ziv-Lempel 77 Ziv-Lempel 78 The LZW variant of Ziv-Lempel 78 Asymptotic optimality of Ziv-Lempel

More information

Lecture #10: RELAX(u, v, w) if d[v] >d[u]+w(u, v) then d[v] d[u]+w(u, v) π[v] u

Lecture #10: RELAX(u, v, w) if d[v] >d[u]+w(u, v) then d[v] d[u]+w(u, v) π[v] u Lecture #:.. raph lgorithms: hortest Path (hapter ) Problem iven a directed graph =[V,], and weight function w : R mapping edges to real valued weights. The weight of a path p = hv o,v,..., v k i is the

More information

MASSACHUSETTS INSTITUTE OF TECHNOLOGY Department of Electrical Engineering and Computer Science Artificial Intelligence Fall, 2010

MASSACHUSETTS INSTITUTE OF TECHNOLOGY Department of Electrical Engineering and Computer Science Artificial Intelligence Fall, 2010 MSSHUSETTS INSTITUTE OF TEHNOLOY epartment of Electrical Engineering and omputer Science 6.0 rtificial Intelligence Fall, 00 Search Me! Recitation, Thursday September Prof. ob erwick. ifference between

More information

Design and Analysis of Algorithms

Design and Analysis of Algorithms S 101, Winter 2018 esign and nalysis of lgorithms Lecture 3: onnected omponents lass URL: http://vlsicad.ucsd.edu/courses/cse101-w18/ nd of Lecture 2: s, Topological Order irected cyclic raph.g., Vertices

More information

An Early Problem in Graph Theory. Clicker Question 1. Konigsberg and the River Pregel

An Early Problem in Graph Theory. Clicker Question 1. Konigsberg and the River Pregel raphs Topic " Hopefully, you've played around a bit with The Oracle of acon at Virginia and discovered how few steps are necessary to link just about anybody who has ever been in a movie to Kevin acon,

More information

Entropy Coding. - to shorten the average code length by assigning shorter codes to more probable symbols => Morse-, Huffman-, Arithmetic Code

Entropy Coding. - to shorten the average code length by assigning shorter codes to more probable symbols => Morse-, Huffman-, Arithmetic Code Entropy Coding } different probabilities for the appearing of single symbols are used - to shorten the average code length by assigning shorter codes to more probable symbols => Morse-, Huffman-, Arithmetic

More information

Data Compression Techniques

Data Compression Techniques Data Compression Techniques Part 2: Text Compression Lecture 6: Dictionary Compression Juha Kärkkäinen 15.11.2017 1 / 17 Dictionary Compression The compression techniques we have seen so far replace individual

More information

Lesson 5.5. Minimum Spanning Trees. Explore This

Lesson 5.5. Minimum Spanning Trees. Explore This Lesson. St harles ounty Minimum Spanning Trees s in many of the previous lessons, this lesson focuses on optimization. Problems and applications here center on two types of problems: finding ways of connecting

More information

Summary. Agenda. Search. Search is a common technique in problem solving. Search Formulation Tree Search Uniform cost search A* Search.

Summary. Agenda. Search. Search is a common technique in problem solving. Search Formulation Tree Search Uniform cost search A* Search. ummary rtificial Intelligence and its applications ecture earch earch onstraint atisfaction Problems rom start state to goal state onsider constraints Professor aniel Yeung danyeung@ieee.org r. Patrick

More information

Note. Out of town Thursday afternoon. Willing to meet before 1pm, me if you want to meet then so I know to be in my office

Note. Out of town Thursday afternoon. Willing to meet before 1pm,  me if you want to meet then so I know to be in my office raphs and Trees Note Out of town Thursday afternoon Willing to meet before pm, email me if you want to meet then so I know to be in my office few extra remarks about recursion If you can write it recursively

More information

Error Resilient LZ 77 Data Compression

Error Resilient LZ 77 Data Compression Error Resilient LZ 77 Data Compression Stefano Lonardi Wojciech Szpankowski Mark Daniel Ward Presentation by Peter Macko Motivation Lempel-Ziv 77 lacks any form of error correction Introducing a single

More information

Network Design and Optimization course

Network Design and Optimization course Effective maximum flow algorithms Modeling with flows Network Design and Optimization course Lecture 5 Alberto Ceselli alberto.ceselli@unimi.it Dipartimento di Tecnologie dell Informazione Università degli

More information

These definitions cover some basic terms and concepts of graph theory and how they have been implemented as C++ classes.

These definitions cover some basic terms and concepts of graph theory and how they have been implemented as C++ classes. hapter 5. raph Theory *raph Theory, *Mathematics raph theory is an area of mathematics which has been incorporated into IS to solve some specific problems in oolean operations and sweeping. It may be also

More information

Basic Search Algorithms

Basic Search Algorithms Basic Search Algorithms Tsan-sheng Hsu tshsu@iis.sinica.edu.tw http://www.iis.sinica.edu.tw/~tshsu 1 Abstract The complexities of various search algorithms are considered in terms of time, space, and cost

More information

Section 7: Dijkstra s

Section 7: Dijkstra s Section 7: ijkstra s Slides by lex Mariakakis with material Kellen onohue, avid Mailhot, and an rossman Late days Things to iscuss o cse33-lateday@cs.washington.edu o 3 assignments left o an use late days

More information

CHAPTER 14 GRAPH ALGORITHMS ORD SFO LAX DFW

CHAPTER 14 GRAPH ALGORITHMS ORD SFO LAX DFW SO OR HPTR 1 GRPH LGORITHMS LX W KNOWLGMNT: THS SLIS R PT ROM SLIS PROVI WITH T STRUTURS N LGORITHMS IN JV, GOORIH, TMSSI N GOLWSSR (WILY 16) 6 OS MINIMUM SPNNING TRS SO 16 PV OR 1 1 16 61 JK 1 1 11 WI

More information

Today s Outline CSE 221: Algorithms and Data Structures Graphs (with no Axes to Grind)

Today s Outline CSE 221: Algorithms and Data Structures Graphs (with no Axes to Grind) Today s Outline S : lgorithms and ata Structures raphs (with no xes to rind) Steve Wolfman 0W Topological Sort: etting to Know raphs with a Sort raph T and raph Representations raph Terminology (a lot

More information

Simple variant of coding with a variable number of symbols and fixlength codewords.

Simple variant of coding with a variable number of symbols and fixlength codewords. Dictionary coding Simple variant of coding with a variable number of symbols and fixlength codewords. Create a dictionary containing 2 b different symbol sequences and code them with codewords of length

More information

CSE 100: GRAPH ALGORITHMS

CSE 100: GRAPH ALGORITHMS CSE 100: GRAPH ALGORITHMS 2 Graphs: Example A directed graph V5 V = { V = E = { E Path: 3 Graphs: Definitions A directed graph V5 V6 A graph G = (V,E) consists of a set of vertices V and a set of edges

More information

Informed (Heuristic) Search. Idea: be smart about what paths to try.

Informed (Heuristic) Search. Idea: be smart about what paths to try. Informed (Heuristic) Search Idea: be smart about what paths to try. 1 Blind Search vs. Informed Search What s the difference? How do we formally specify this? A node is selected for expansion based on

More information

What is Search? Intro to Search. Search problems. Finding goals in trees. Why is goal search not trivial? Blind Search Methods

What is Search? Intro to Search. Search problems. Finding goals in trees. Why is goal search not trivial? Blind Search Methods What is Search? lind Search Methods Search as an Tool S, DS, DS, US, ids Search is one of the most powerful approaches to problem solving in Search is a universal problem solving mechanism that Systematically

More information

An iteration of Branch and Bound One iteration of Branch and Bound consists of the following four steps: Some definitions. Branch and Bound.

An iteration of Branch and Bound One iteration of Branch and Bound consists of the following four steps: Some definitions. Branch and Bound. ranch and ound xamples and xtensions jesla@man.dtu.dk epartment of Management ngineering Technical University of enmark ounding ow do we get ourselves a bounding function? Relaxation. Leave out some constraints.

More information

COMP4128 Programming Challenges

COMP4128 Programming Challenges Network Networks Network COMP4128 Programming Challenges School of Computer Science and Engineering UNSW Australia Table of Contents 2 Network 1 Networks Networks 2 3 4 5 6 networks 3 Network Networks

More information

Analysis of Algorithms Prof. Karen Daniels

Analysis of Algorithms Prof. Karen Daniels UMass Lowell omputer Science 91.404 nalysis of lgorithms Prof. Karen aniels Spring, 2013 hapter 22: raph lgorithms & rief Introduction to Shortest Paths [Source: ormen et al. textbook except where noted]

More information

CS2210 Data Structures and Algorithms

CS2210 Data Structures and Algorithms S1 ata Structures and Algorithms Lecture 1 : Shortest Paths A 4 1 5 5 3 4 Goodrich, Tamassia Outline Weighted Graphs Shortest Paths Algorithm (ijkstra s) Weighted Graphs ach edge has an associated numerical

More information

Route planning / Search Movement Group behavior Decision making

Route planning / Search Movement Group behavior Decision making Game AI Where is the AI Route planning / Search Movement Group behavior Decision making General Search Algorithm Design Keep a pair of set of states: One, the set of states to explore, called the open

More information

Uninformed Search. Models To Be Studied in CS 540. Chapter Search Example: Route Finding

Uninformed Search. Models To Be Studied in CS 540. Chapter Search Example: Route Finding Models To e tudied in 50 Uninformed earch hapter 3. 3. tate-based Models Model task as a graph of all possible states l alled a state-space graph state captures all the relevant information about the past

More information

ITCT Lecture 8.2: Dictionary Codes and Lempel-Ziv Coding

ITCT Lecture 8.2: Dictionary Codes and Lempel-Ziv Coding ITCT Lecture 8.2: Dictionary Codes and Lempel-Ziv Coding Huffman codes require us to have a fairly reasonable idea of how source symbol probabilities are distributed. There are a number of applications

More information

Module 5 Graph Algorithms

Module 5 Graph Algorithms Module 5 Graph lgorithms Dr. Natarajan Meghanathan Professor of Computer Science Jackson State University Jackson, MS 97 E-mail: natarajan.meghanathan@jsums.edu 5. Graph Traversal lgorithms Depth First

More information

Execution Tracing and Profiling

Execution Tracing and Profiling lass 8 Questions/comments iscussion of academic honesty, GT Honor ode fficient path profiling inal project presentations: ec, 3; 4:35-6:45 ssign (see Schedule for links) Problem Set 7 discuss Readings

More information

Minimum Spanning Trees

Minimum Spanning Trees Minimum Spanning Trees 0 OS SO LX PV OR 0 JK 0 WI 00 W MI 00 Goodrich, Tamassia Minimum Spanning Trees Minimum Spanning Trees Spanning subgraph Subgraph of a graph G containing all the vertices of G Spanning

More information

Week 9 Student Responsibilities. Mat Example: Minimal Spanning Tree. 3.3 Spanning Trees. Prim s Minimal Spanning Tree.

Week 9 Student Responsibilities. Mat Example: Minimal Spanning Tree. 3.3 Spanning Trees. Prim s Minimal Spanning Tree. Week 9 Student Responsibilities Reading: hapter 3.3 3. (Tucker),..5 (Rosen) Mat 3770 Spring 01 Homework Due date Tucker Rosen 3/1 3..3 3/1 DS & S Worksheets 3/6 3.3.,.5 3/8 Heapify worksheet ttendance

More information

ECE 242 Data Structures and Algorithms. Graphs II. Lecture 27. Prof.

ECE 242 Data Structures and Algorithms.  Graphs II. Lecture 27. Prof. 242 ata Structures and lgorithms http://www.ecs.umass.edu/~polizzi/teaching/242/ Graphs II Lecture 27 Prof. ric Polizzi Summary Previous Lecture omposed of vertices (nodes) and edges vertex or node edges

More information

Introduction. Example

Introduction. Example OMS0 Introduction Priority queues and ijkstra s algorithm In this lecture we will discuss ijkstra s algorithm, a more efficient way of solving the single-source shortest path problem. epartment of omputer

More information

Lempel-Ziv-Welch (LZW) Compression Algorithm

Lempel-Ziv-Welch (LZW) Compression Algorithm Lempel-Ziv-Welch (LZW) Compression lgorithm Introduction to the LZW lgorithm Example 1: Encoding using LZW Example 2: Decoding using LZW LZW: Concluding Notes Introduction to LZW s mentioned earlier, static

More information

Adjacency Matrix Undirected Graph. » Matrix [ p, q ] is 1 (True) if < p, q > is an edge in the graph. Graphs Representation & Paths

Adjacency Matrix Undirected Graph. » Matrix [ p, q ] is 1 (True) if < p, q > is an edge in the graph. Graphs Representation & Paths djacency Matrix Undirected Graph Row and column indices are vertex numbers Graphs Representation & Paths Mixture of Chapters 9 & 0» Matrix [ p, q ] is (True) if < p, q > is an edge in the graph if < p,

More information

An Early Problem in Graph Theory

An Early Problem in Graph Theory raphs Topic 2 " Hopefully, you've played around a bit with The Oracle of acon at Virginia and discovered how few steps are necessary to link just about anybody who has ever been in a movie to Kevin acon,

More information

Single Source, Shortest Path Problem

Single Source, Shortest Path Problem Lecture : From ijkstra to Prim Today s Topics: ijkstra s Shortest Path lgorithm epth First Search Spanning Trees Minimum Spanning Trees Prim s lgorithm overed in hapter 9 in the textbook Some slides based

More information

/633 Introduction to Algorithms Lecturer: Michael Dinitz Topic: Priority Queues / Heaps Date: 9/27/17

/633 Introduction to Algorithms Lecturer: Michael Dinitz Topic: Priority Queues / Heaps Date: 9/27/17 01.433/33 Introduction to Algorithms Lecturer: Michael Dinitz Topic: Priority Queues / Heaps Date: 9/2/1.1 Introduction In this lecture we ll talk about a useful abstraction, priority queues, which are

More information

CSE 332: Data Structures & Parallelism Lecture 22: Minimum Spanning Trees. Ruth Anderson Winter 2018

CSE 332: Data Structures & Parallelism Lecture 22: Minimum Spanning Trees. Ruth Anderson Winter 2018 SE 33: Data Structures & Parallelism Lecture : Minimum Spanning Trees Ruth nderson Winter 08 Minimum Spanning Trees iven an undirected graph =(V,E), find a graph =(V, E ) such that: E is a subset of E

More information

ECE 158A: Lecture 5. Fall 2015

ECE 158A: Lecture 5. Fall 2015 8: Lecture Fall 0 Routing ()! Location-ased ddressing Recall from Lecture that routers maintain routing tables to forward packets based on their IP addresses To allow scalability, IP addresses are assigned

More information

Informed Search. CMU Snake Robot. Administrative. Uninformed search strategies. Assignment 1 was due before class how d it go?

Informed Search. CMU Snake Robot. Administrative. Uninformed search strategies. Assignment 1 was due before class how d it go? Informed Search S151 David Kauchak Fall 2010 MU Snake Robot http://www-cgi.cs.cmu.edu/afs/cs.cmu.edu/web/people/biorobotics/projects/ modsnake/index.html Some material borrowed from : Sara Owsley Sood

More information

Test points UTA Student ID #

Test points UTA Student ID # CSE Name Test points UTA Student ID # Multiple Choice. Write your answer to the LEFT of each problem. points each. Which of the following statements is true about HEAPSOT? A. It is stable.. It has a worse-case

More information

Learning Objectives. c D. Poole and A. Mackworth 2010 Artificial Intelligence, Lecture 3.3, Page 1

Learning Objectives. c D. Poole and A. Mackworth 2010 Artificial Intelligence, Lecture 3.3, Page 1 Learning Objectives At the end of the class you should be able to: devise an useful heuristic function for a problem demonstrate how best-first and A search will work on a graph predict the space and time

More information

Dynamic-Programming algorithms for shortest path problems: Bellman-Ford (for singlesource) and Floyd-Warshall (for all-pairs).

Dynamic-Programming algorithms for shortest path problems: Bellman-Ford (for singlesource) and Floyd-Warshall (for all-pairs). Lecture 13 Graph Algorithms I 13.1 Overview This is the first of several lectures on graph algorithms. We will see how simple algorithms like depth-first-search can be used in clever ways (for a problem

More information

Routers & Routing : Computer Networking. Binary Search on Ranges. Speeding up Prefix Match - Alternatives

Routers & Routing : Computer Networking. Binary Search on Ranges. Speeding up Prefix Match - Alternatives Routers & Routing -44: omputer Networking High-speed router architecture Intro to routing protocols ssigned reading [McK9] Fast Switched ackplane for a Gigabit Switched Router Know RIP/OSPF L-4 Intra-omain

More information

L10 Graphs. Alice E. Fischer. April Alice E. Fischer L10 Graphs... 1/37 April / 37

L10 Graphs. Alice E. Fischer. April Alice E. Fischer L10 Graphs... 1/37 April / 37 L10 Graphs lice. Fischer pril 2016 lice. Fischer L10 Graphs... 1/37 pril 2016 1 / 37 Outline 1 Graphs efinition Graph pplications Graph Representations 2 Graph Implementation 3 Graph lgorithms Sorting

More information

(Refer Slide Time: 00:18)

(Refer Slide Time: 00:18) Programming, Data Structures and Algorithms Prof. N. S. Narayanaswamy Department of Computer Science and Engineering Indian Institute of Technology, Madras Module 11 Lecture 58 Problem: single source shortest

More information

Routing. Effect of Routing in Flow Control. Relevant Graph Terms. Effect of Routing Path on Flow Control. Effect of Routing Path on Flow Control

Routing. Effect of Routing in Flow Control. Relevant Graph Terms. Effect of Routing Path on Flow Control. Effect of Routing Path on Flow Control Routing Third Topic of the course Read chapter of the text Read chapter of the reference Main functions of routing system Selection of routes between the origin/source-destination pairs nsure that the

More information

CS/COE 1501 cs.pitt.edu/~bill/1501/ Network Flow

CS/COE 1501 cs.pitt.edu/~bill/1501/ Network Flow CS/COE 1501 cs.pitt.edu/~bill/1501/ Network Flow Defining network flow Consider a directed, weighted graph G(V, E) Weights are applied to edges to state their capacity c(u, w) is the capacity of edge (u,

More information

CSE 373: Data Structures and Algorithms. Graph Traversals. Autumn Shrirang (Shri) Mare

CSE 373: Data Structures and Algorithms. Graph Traversals. Autumn Shrirang (Shri) Mare SE 373: ata Structures and lgorithms Graph Traversals utumn 2018 Shrirang (Shri) Mare shri@cs.washington.edu Thanks to Kasey hampion, en Jones, dam lank, Michael Lee, Evan Mcarty, Robbie Weber, Whitaker

More information

Algorithms and Data Structures

Algorithms and Data Structures Algorithms and Data Structures Graphs : Shortest Paths Marius Kloft Content of this Lecture Single-Source-Shortest-Paths: Dijkstra s Algorithm Single-Source-Single-Target All-Pairs Shortest Paths Transitive

More information

16.1 Maximum Flow Definitions

16.1 Maximum Flow Definitions 5-499: Parallel Algorithms Lecturer: Guy Blelloch Topic: Graphs IV Date: March 5, 009 Scribe: Bobby Prochnow This lecture describes both sequential and parallel versions of a maximum flow algorithm based

More information

Multiple Choice. Write your answer to the LEFT of each problem. 3 points each

Multiple Choice. Write your answer to the LEFT of each problem. 3 points each CSE 0-00 Test Spring 0 Name Last 4 Digits of Student ID # Multiple Choice. Write your answer to the LEFT of each problem. points each. Suppose f ( x) is a monotonically increasing function. Which of the

More information

Overview. CSE 548: (Design and) Analysis of Algorithms. Making change. When does a Greedy algorithm work?

Overview. CSE 548: (Design and) Analysis of Algorithms. Making change. When does a Greedy algorithm work? Overview S 8: (esign and) nalysis of lgorithms Greedy lgorithms R. Sekar One of the strategies used to solve optimization problems Multiple solutions exist; pick one of low (or least) cost Greedy strategy:

More information

The wolf sheep cabbage problem. Search. Terminology. Solution. Finite state acceptor / state space

The wolf sheep cabbage problem. Search. Terminology. Solution. Finite state acceptor / state space Search The wolf sheep cabbage problem What is search? Terminology: search space, strategy Modelling Uninformed search (not intelligent ) Breadth first Depth first, some variations omplexity space and time

More information

Maximum Flow. Flow Networks. Flow Networks Ford-Fulkerson Method Edmonds-Karp Algorithm Push-Relabel Algorithms. Example Flow Network

Maximum Flow. Flow Networks. Flow Networks Ford-Fulkerson Method Edmonds-Karp Algorithm Push-Relabel Algorithms. Example Flow Network Flow Networks Ford-Fulkerson Method Edmonds-Karp Algorithm Push-Relabel Algorithms Maximum Flow Flow Networks A flow network is a directed graph where: Each edge (u,v) has a capacity c(u,v) 0. If (u,v)

More information

Partitioning. Partitioning Levels. Chip. Readings: Chapter 2. Circuits can exceed chip capacity. Partitioning

Partitioning. Partitioning Levels. Chip. Readings: Chapter 2. Circuits can exceed chip capacity. Partitioning Partitioning Readings: hapter 2 ircuits can exceed chip capacity Split circuits into chip-sized subcircuits Meet capacity constraints Reduce interconnect demand Meet performance requirements Partitioning

More information

CSE 100: GRAPH ALGORITHMS

CSE 100: GRAPH ALGORITHMS CSE 100: GRAPH ALGORITHMS Dijkstra s Algorithm: Questions Initialize the graph: Give all vertices a dist of INFINITY, set all done flags to false Start at s; give s dist = 0 and set prev field to -1 Enqueue

More information

Section 5: HW6 and Interfaces

Section 5: HW6 and Interfaces Section 5: HW6 and Interfaces How is Homework 5 going? SLIS PT FROM LX MRIKKIS, WITH MTRIL FROM KRYST YOUSOUFIN, MIK RNST, KLLN ONOHU genda Reminders HW 5 due tonight (7/9) HW 6 due next Thursday (7/6)

More information

Weighted Graphs ( 12.5) Shortest Paths. Shortest Paths ( 12.6) Shortest Path Properties PVD ORD SFO LGA HNL LAX DFW MIA PVD PVD ORD ORD SFO SFO LGA

Weighted Graphs ( 12.5) Shortest Paths. Shortest Paths ( 12.6) Shortest Path Properties PVD ORD SFO LGA HNL LAX DFW MIA PVD PVD ORD ORD SFO SFO LGA Shortest Paths A Weighted Graphs (.) In a weighted graph, each edge has an associated numerical value, called the weight of the edge dge weights may represent, distances, costs, etc. xample: In a flight

More information

Multimedia Systems. Part 20. Mahdi Vasighi

Multimedia Systems. Part 20. Mahdi Vasighi Multimedia Systems Part 2 Mahdi Vasighi www.iasbs.ac.ir/~vasighi Department of Computer Science and Information Technology, Institute for dvanced Studies in asic Sciences, Zanjan, Iran rithmetic Coding

More information

Weekly Assignment nr.4

Weekly Assignment nr.4 UNIVERSITY OF OSLO, INSTITUTE OF INFORMATICS Weekly Assignment nr.4 1 FLOW NETWORKS Prerequisites: Graphs(directed, undirected) Degrees, neighbours, paths Depth-first, Breadth-first Lesson Plan: 1. Flow

More information

Programming Abstractions

Programming Abstractions Programming bstractions S 1 0 6 X ynthia ee Upcoming Topics raphs! 1. asics What are they? ow do we represent them? 2. Theorems What are some things we can prove about graphs? 3. readth-first search on

More information

CS 124: Course Review for Final Exam. Grades So Far (with Top Students) Exam Format: Similar to Midterms Class Quizzes Some Topic Highlights

CS 124: Course Review for Final Exam. Grades So Far (with Top Students) Exam Format: Similar to Midterms Class Quizzes Some Topic Highlights S : ourse Review for inal xam Grades So ar (with Top Students) xam ormat: Similar to Midterms lass Quizzes Some Topic Highlights Illustrations of O,, (lass Quiz ) f (N) g (N) g (N) True or false?. g (N)=O(f

More information

CS 125 Section #10 Midterm 2 Review 11/5/14

CS 125 Section #10 Midterm 2 Review 11/5/14 CS 125 Section #10 Midterm 2 Review 11/5/14 1 Topics Covered This midterm covers up through NP-completeness; countability, decidability, and recognizability will not appear on this midterm. Disclaimer:

More information

Greedy Algorithms CHAPTER 16

Greedy Algorithms CHAPTER 16 CHAPTER 16 Greedy Algorithms In dynamic programming, the optimal solution is described in a recursive manner, and then is computed ``bottom up''. Dynamic programming is a powerful technique, but it often

More information

Graphs. Edges may be directed (from u to v) or undirected. Undirected edge eqvt to pair of directed edges

Graphs. Edges may be directed (from u to v) or undirected. Undirected edge eqvt to pair of directed edges (p 186) Graphs G = (V,E) Graphs set V of vertices, each with a unique name Note: book calls vertices as nodes set E of edges between vertices, each encoded as tuple of 2 vertices as in (u,v) Edges may

More information

1. [1 pt] What is the solution to the recurrence T(n) = 2T(n-1) + 1, T(1) = 1

1. [1 pt] What is the solution to the recurrence T(n) = 2T(n-1) + 1, T(1) = 1 Asymptotics, Recurrence and Basic Algorithms 1. [1 pt] What is the solution to the recurrence T(n) = 2T(n-1) + 1, T(1) = 1 1. O(logn) 2. O(n) 3. O(nlogn) 4. O(n 2 ) 5. O(2 n ) 2. [1 pt] What is the solution

More information

What is Routing? EE 122: Shortest Path Routing. Example. Internet Routing. Ion Stoica TAs: Junda Liu, DK Moon, David Zats

What is Routing? EE 122: Shortest Path Routing. Example. Internet Routing. Ion Stoica TAs: Junda Liu, DK Moon, David Zats What is Routing? Routing implements the core function of a network: : Shortest Path Routing Ion Stoica Ts: Junda Liu, K Moon, avid Zats http://inst.eecs.berkeley.edu/~ee/fa9 (Materials with thanks to Vern

More information

Object-oriented programming. and data-structures CS/ENGRD 2110 SUMMER 2018

Object-oriented programming. and data-structures CS/ENGRD 2110 SUMMER 2018 Object-oriented programming and data-structures CS/ENGRD 20 SUMMER 208 Lecture 3: Shortest Path http://courses.cs.cornell.edu/cs20/208su Graph Algorithms Search Depth-first search Breadth-first search

More information

and 6.855J March 6, Maximum Flows 2

and 6.855J March 6, Maximum Flows 2 5.08 and.855j March, 00 Maximum Flows Network Reliability Communication Network What is the maximum number of arc disjoint paths from s to t? How can we determine this number? Theorem. Let G = (N,A) be

More information

CS 188: Artificial Intelligence Fall Search Gone Wrong?

CS 188: Artificial Intelligence Fall Search Gone Wrong? CS 188: Artificial Intelligence Fall 2009 Lecture 3: A* Search 9/3/2009 Pieter Aeel UC Berkeley Many slides from Dan Klein Search Gone Wrong? 1 Announcements Assignments: Project 0 (Python tutorial): due

More information

Test 1 Last 4 Digits of Mav ID # Multiple Choice. Write your answer to the LEFT of each problem. 2 points each t 1

Test 1 Last 4 Digits of Mav ID # Multiple Choice. Write your answer to the LEFT of each problem. 2 points each t 1 CSE 0 Name Test Fall 00 Last Digits of Mav ID # Multiple Choice. Write your answer to the LEFT of each problem. points each t. What is the value of k? k=0 A. k B. t C. t+ D. t+ +. Suppose that you have

More information

16 Greedy Algorithms

16 Greedy Algorithms 16 Greedy Algorithms Optimization algorithms typically go through a sequence of steps, with a set of choices at each For many optimization problems, using dynamic programming to determine the best choices

More information