CS2351 Data Structures. Tutorial 3: Data Structures for Disjoint Sets

Size: px
Start display at page:

Download "CS2351 Data Structures. Tutorial 3: Data Structures for Disjoint Sets"

Transcription

1 CS2351 Data Structures Tutorial 3: Data Structures or Disjoint Sets 1

2 Aout this lecture Data Structure or Disjoint Sets Support Union and Find operations Various Methods: 1. Union y Size 2. Union y Rank 3. Union y Rank + Path Compression 2

3 Maintainin Disjoint Set In some applications, especially in alorithms relatin to raphs, we oten have a set o elements, and want to maintain a dynamic partition o them I.e., the partition chanes over time Our taret corresponds to maintainin dynamic disjoint sets o the elements 3

4 Maintainin Disjoint Set Let Σ = { S 1, S 2,, S k } e a collection o dynamic disjoint sets o the elements Let x and y e any two elements We want to support: Make-Set(x): create a set containin x Find(x) : return which set x elons Union(x,y) : mere the sets containin x and containin y into one 4

5 Example Application: Findin Connected Components Step 0: Bein with the input raph a e h c d 5

6 Example Application: Findin Connected Components Step 1: Make-Set(v) or each vertex v a e h c d current Σ: { {a}, {}, {c}, {d}, {e}, {}, {}, {h} } 6

7 Example Application: Findin Connected Components Step 2: Visit each ede (u,v), perorm Union(u,v) a e h c d current Σ: { {a}, {}, {c}, {d}, {e}, {}, {}, {h} } 7

8 Step 2: Visit (a,) a e h ede visited c d current Σ: { {a,}, {c}, {d}, {e}, {}, {}, {h} } Step 2: Visit (c,d) a e h c d current Σ: { {a,}, {c,d}, {e}, {}, {}, {h} } 8

9 Step 2: Visit (e,) a e h ede visited c d current Σ: { {a,}, {c,d}, {e,}, {}, {h} } Step 2: Visit (,c) a e h c d current Σ: { {a,,c,d}, {e,}, {}, {h} } 9

10 Step 2: Visit (,) a e h ede visited c d current Σ: { {a,,c,d}, {e,,}, {h} } Step 2: Visit (,d) a e h c d current Σ: { {a,,c,d}, {e,,}, {h} } 10

11 Example Application: Findin Connected Components Ater Step 2 (when all edes visited) : Each Disjoint Set Connected Component a e h c d current Σ: { {a,,c,d}, {e,,}, {h} } 11

12 Remarks To acilitate Find(x), each set usually chooses one o its element as a representative Find(x) returns the representative element o the set where x elons To check i x and y elon to the same set, we can just check i Find(x) == Find(y) 12

13 Disjoint-Set Forest One popular method to maintain disjoint sets is y a orest Each set a separate rooted tree Representative root o tree 13

14 Example Current dynamic sets : { {a,,c,d}, {e,,}, {h} } h a c d e 14

15 Disjoint-Set Forest To perorm Union(x,y), we join the trees containin x and containin y, y linkin their roots E.. Union(,h) in previous example ives: h e 15

16 Disjoint-Set Forest Let H max = max heiht o all trees In the worst-case: Make-Set : Find or Union : Θ(1) time Ο(H max ) time m operations on n elements : worst-case Θ(mn) time 16

17 Union By Size Let us apply a union-y-size heuristic : To perorm Union, we link root o the smaller tree to root o the larer tree H max = Ο(lo n) (how to prove??) m operations : Θ(m lo n) time 17

18 Union By Rank A similar heuristic is called union-y-rank Each node keeps track o its rank an upper ound on the heiht o the node In a sinle-node tree (created y Make-Set) rank o root = 0 To perorm Union, we link root with smaller rank to root with larer rank 18

19 Union By Rank Rank needs not e very accurate as lon as it always ives an upper ound o heiht is enouh When Union is perormed, only the rank o the roots may chane : I oth roots have same rank rank o new root increases y 1 Else, no chane 19

20 Example o Union y Rank Beore Union Ater Union(c,) a c d e a c d 0 e 0? = rank 20

21 Union By Rank Let H max = max heiht o all trees H max = Ο(lo n) (how to prove??) m operations : Θ(m lo n) time So, union y rank is no etter than union y size, ut 21

22 Path Compression The closer a node to its root, the aster the Find or Union operation When we perorm Find(x), we will need to ind the root o the tree containin x will access every ancestor o x why don t we make all these ancestors o x closer to the root now? ( Because no increase in asymptotic perormance!!! ) 22

23 Example o Path Compression Beore Find(x) Ater Find(x) w v u x w v u x 23

24 Union y Rank + Path Compression I Union(x,y) is always perormed y irst Find(x), Find(y), and then linkin the roots, then y cominin union-y-rank (at Union) and path compression (at Find and Union) : m operations: Θ(m α(n)) time Inverse Ackermann (in practice, at most 4) 24

25 Findin Connected Components Recall: To ind connected components o a raph G with n vertices and m edes there are n Make-Set and m Find or Union operations Which scheme or dynamic disjoint sets ives the est runnin time (theoretically)? Ans. Depends on m (why?) 25

CS4311 Design and Analysis of Algorithms. Analysis of Union-By-Rank with Path Compression

CS4311 Design and Analysis of Algorithms. Analysis of Union-By-Rank with Path Compression CS4311 Design and Analysis of Algorithms Tutorial: Analysis of Union-By-Rank with Path Compression 1 About this lecture Introduce an Ackermann-like function which grows even faster than Ackermann Use it

More information

CS 161: Design and Analysis of Algorithms

CS 161: Design and Analysis of Algorithms CS 161: Design and Analysis of Algorithms Greedy Algorithms 3: Minimum Spanning Trees/Scheduling Disjoint Sets, continued Analysis of Kruskal s Algorithm Interval Scheduling Disjoint Sets, Continued Each

More information

Data Structures for Disjoint Sets

Data Structures for Disjoint Sets Data Structures for Disjoint Sets Advanced Data Structures and Algorithms (CLRS, Chapter 2) James Worrell Oxford University Computing Laboratory, UK HT 200 Disjoint-set data structures Also known as union

More information

Equivalence Relations. Disjoint Union / Find. Dynamic Equivalence Problem. Equivalence Classes

Equivalence Relations. Disjoint Union / Find. Dynamic Equivalence Problem. Equivalence Classes Disjoint Union / Find CSE Data Structures Unit Reading: Chapter 8 Equivalence Relations A relation R is defined on set S if for every pair of elements a, b S, a R b is either true or false An equivalence

More information

Equivalence Relations. Equivalence Classes. A new question. Building Equivalence Classes. CSE 326: Data Structures Disjoint Union/Find

Equivalence Relations. Equivalence Classes. A new question. Building Equivalence Classes. CSE 326: Data Structures Disjoint Union/Find Equivalence Relations CE : Data tructures Disjoint Union/Find Relation R : For every pair of elements (a, b) in a set, a R b is either true or false If a R b is true, then a is related to b An equivalence

More information

Equivalence Relation. Equivalence Classes. Building Equivalence Classes. Disjoint Union Find 2016/2/9. Determining equivalence classes

Equivalence Relation. Equivalence Classes. Building Equivalence Classes. Disjoint Union Find 2016/2/9. Determining equivalence classes 0//9 Equivalence Relation Chapter Union Find for Disjoint ets Relation R on is a subset of x For every pair of elements a, b from a set, a R b is either true or false a R b is true iff (a, b) is in R In

More information

Presentation for use with the textbook, Algorithm Design and Applications, by M. T. Goodrich and R. Tamassia, Wiley, Union-Find Structures

Presentation for use with the textbook, Algorithm Design and Applications, by M. T. Goodrich and R. Tamassia, Wiley, Union-Find Structures Presentation for use with the textbook, Algorithm Design and Applications, by M. T. Goodrich and R. Tamassia, Wiley, 2015 Union-Find Structures 1 Equivalence Relation Relation R on S is a subset of SxS.

More information

Connected-components. Summary of lecture 9. Algorithms and Data Structures Disjoint sets. Example: connected components in graphs

Connected-components. Summary of lecture 9. Algorithms and Data Structures Disjoint sets. Example: connected components in graphs Prm University, Mth. Deprtment Summry of lecture 9 Algorithms nd Dt Structures Disjoint sets Summry of this lecture: (CLR.1-3) Dt Structures for Disjoint sets: Union opertion Find opertion Mrco Pellegrini

More information

Disjoint Sets : ADT. Disjoint-Set : Find-Set

Disjoint Sets : ADT. Disjoint-Set : Find-Set Disjoint Sets : ADT Disjoint-Set Forests Make-Set( x ) Union( s, s ) Find-Set( x ) : π( ) : π( ) : ν( log * n ) amortized cost 6 9 {,, 9,, 6} set # {} set # 7 5 {5, 7, } set # Disjoint-Set : Find-Set Disjoint

More information

Computing Connected Components Given a graph G = (V; E) compute the connected components of G. Connected-Components(G) 1 for each vertex v 2 V [G] 2 d

Computing Connected Components Given a graph G = (V; E) compute the connected components of G. Connected-Components(G) 1 for each vertex v 2 V [G] 2 d Data Structures for Disjoint Sets Maintain a Dynamic collection of disjoint sets. Each set has a unique representative (an arbitrary member of the set). x. Make-Set(x) - Create a new set with one member

More information

Disjoint-Set Forests

Disjoint-Set Forests Disjoint-Set Forests Thanks for Showing Up! Outline for Today Incremental Connectivity Maintaining connectivity as edges are added to a graph. Disjoint-Set Forests A simple data structure for incremental

More information

9 Union Find. 9 Union Find. List Implementation. 9 Union Find. Union Find Data Structure P: Maintains a partition of disjoint sets over elements.

9 Union Find. 9 Union Find. List Implementation. 9 Union Find. Union Find Data Structure P: Maintains a partition of disjoint sets over elements. Union Find Data Structure P: Maintains a partition of disjoint sets over elements. P. makeset(x): Given an element x, adds x to the data-structure and creates a singleton set that contains only this element.

More information

Chapter 8 The Disjoint Sets Class

Chapter 8 The Disjoint Sets Class Chapter 8 The Disjoint Sets Class 2 Introduction equivalence problem can be solved fairly simply simple data structure each function requires only a few lines of code two operations: and can be implemented

More information

CS 410/584, Algorithm Design & Analysis: Lecture Notes 3

CS 410/584, Algorithm Design & Analysis: Lecture Notes 3 CS 410/584, : Lecture Notes 3 Amortized Cost Not an algorithm design mechanism per se For analyzing cost of algorithms - - Example: Exercise 17.3-6 Implement a queue with two stacks Why? 1 enqueue(x, Q)

More information

CSE 202: Design and Analysis of Algorithms Lecture 3

CSE 202: Design and Analysis of Algorithms Lecture 3 CSE 202: Design and Analysis of Algorithms Lecture 3 Instructor: Kamalika Chaudhuri Announcement Homework 1 out Due on Tue Jan 24 in class No late homeworks will be accepted Greedy Algorithms Direct argument

More information

CSE 332. Data Abstractions

CSE 332. Data Abstractions Adam Blank Lecture 23 Autumn 2015 CSE 332 Data Abstractions CSE 332: Data Abstractions Graphs 4: Minimum Spanning Trees Final Dijkstra s Algorithm 1 1 dijkstra(g, source) { 2 dist = new Dictionary(); 3

More information

Greedy Algorithms and Data Compression. Curs 2018

Greedy Algorithms and Data Compression. Curs 2018 Greedy Algorithms and Data Compression. Curs 2018 Greedy Algorithms A greedy algorithm, is a technique that always makes a locally optimal choice in the myopic hope that this choice will lead to a globally

More information

Maximum Flow. Reading: CLRS Chapter 26. CSE 6331 Algorithms Steve Lai

Maximum Flow. Reading: CLRS Chapter 26. CSE 6331 Algorithms Steve Lai Maximum Flow Reading: CLRS Chapter 26. CSE 6331 Algorithms Steve Lai Flow Network A low network G ( V, E) is a directed graph with a source node sv, a sink node tv, a capacity unction c. Each edge ( u,

More information

9. v > 7.3 mi/h x < 2.5 or x > x between 1350 and 5650 hot dogs

9. v > 7.3 mi/h x < 2.5 or x > x between 1350 and 5650 hot dogs .5 Etra Practice. no solution. (, 0) and ( 9, ). (, ) and (, ). (, 0) and (, 0) 5. no solution. ( + 5 5 + 5, ) and ( 5 5 5, ) 7. (0, ) and (, 0). (, ) and (, 0) 9. (, 0) 0. no solution. (, 5). a. Sample

More information

25. Minimum Spanning Trees

25. Minimum Spanning Trees Problem Given: Undirected, weighted, connected graph G = (V, E, c). 5. Minimum Spanning Trees Motivation, Greedy, Algorithm Kruskal, General Rules, ADT Union-Find, Algorithm Jarnik, Prim, Dijkstra, Fibonacci

More information

25. Minimum Spanning Trees

25. Minimum Spanning Trees 695 25. Minimum Spanning Trees Motivation, Greedy, Algorithm Kruskal, General Rules, ADT Union-Find, Algorithm Jarnik, Prim, Dijkstra, Fibonacci Heaps [Ottman/Widmayer, Kap. 9.6, 6.2, 6.1, Cormen et al,

More information

Lecture 6 January 15, 2014

Lecture 6 January 15, 2014 Advanced Graph Algorithms Jan-Apr 2014 Lecture 6 January 15, 2014 Lecturer: Saket Sourah Scrie: Prafullkumar P Tale 1 Overview In the last lecture we defined simple tree decomposition and stated that for

More information

Divide-and-conquer: Order Statistics. Curs: Fall 2017

Divide-and-conquer: Order Statistics. Curs: Fall 2017 Divide-and-conquer: Order Statistics Curs: Fall 2017 The divide-and-conquer strategy. 1. Break the problem into smaller subproblems, 2. recursively solve each problem, 3. appropriately combine their answers.

More information

Curve Sketching. The process of curve sketching can be performed in the following steps:

Curve Sketching. The process of curve sketching can be performed in the following steps: Curve Sketching So ar you have learned how to ind st and nd derivatives o unctions and use these derivatives to determine where a unction is:. Increasing/decreasing. Relative extrema 3. Concavity 4. Points

More information

( x) f = where P and Q are polynomials.

( x) f = where P and Q are polynomials. 9.8 Graphing Rational Functions Lets begin with a deinition. Deinition: Rational Function A rational unction is a unction o the orm ( ) ( ) ( ) P where P and Q are polynomials. Q An eample o a simple rational

More information

Topics in Theoretical Computer Science April 08, Lecture 8

Topics in Theoretical Computer Science April 08, Lecture 8 Topics in Theoretical Computer Science April 08, 204 Lecture 8 Lecturer: Ola Svensson Scribes: David Leydier and Samuel Grütter Introduction In this lecture we will introduce Linear Programming. It was

More information

Branch-and-Bound for the Travelling Salesman Problem

Branch-and-Bound for the Travelling Salesman Problem Branch-and-Bound for the Travelling Salesman Problem Leo Liberti LIX, École Polytechnique, F-91128 Palaiseau, France Email:liberti@lix.polytechnique.fr March 15, 2011 Contents 1 The setting 1 1.1 Graphs...............................................

More information

Exact Inference: Variable Elimination

Exact Inference: Variable Elimination Readings: K&F 9.2 9. 9.4 9.5 Exact nerence: Variable Elimination ecture 6-7 Apr 1/18 2011 E 515 tatistical Methods pring 2011 nstructor: u-n ee University o Washington eattle et s revisit the tudent Network

More information

Transformations of Quadratic Functions

Transformations of Quadratic Functions .1 Transormations o Quadratic Functions Essential Question How do the constants a, h, and k aect the raph o the quadratic unction () = a( h) + k? The parent unction o the quadratic amil is. A transormation

More information

Finger Search in the Implicit Model

Finger Search in the Implicit Model Finger Search in the Implicit Model Gerth Stølting Brodal, Jesper Sindahl Nielsen, Jakob Truelsen MADALGO, Department o Computer Science, Aarhus University, Denmark. {gerth,jasn,jakobt}@madalgo.au.dk Abstract.

More information

v( t) g 2 v 0 sin θ ( ) ( ) g t ( ) = 0

v( t) g 2 v 0 sin θ ( ) ( ) g t ( ) = 0 PROJECTILE MOTION Velocity We seek to explore the velocity of the projectile, includin its final value as it hits the round, or a taret above the round. The anle made by the velocity vector with the local

More information

1 CHAPTER 7 PROJECTILES. 7.1 No Air Resistance

1 CHAPTER 7 PROJECTILES. 7.1 No Air Resistance CHAPTER 7 PROJECTILES 7 No Air Resistance We suppose that a particle is projected from a point O at the oriin of a coordinate system, the y-axis bein vertical and the x-axis directed alon the round The

More information

A Dichotomy. in in Probabilistic Databases. Joint work with Robert Fink. for Non-Repeating Queries with Negation Queries with Negation

A Dichotomy. in in Probabilistic Databases. Joint work with Robert Fink. for Non-Repeating Queries with Negation Queries with Negation Dichotomy for Non-Repeating Queries with Negation Queries with Negation in in Probabilistic Databases Robert Dan Olteanu Fink and Dan Olteanu Joint work with Robert Fink Uncertainty in Computation Simons

More information

Computing Congruences Efficiently

Computing Congruences Efficiently Computing Congruences Efficiently Ralph Freese March 15, 1999 Let A be a finite algebra and let θ be a partition of A. Inthisnotewe give a simple algorithm for computing the smallest congruence containing

More information

Greedy Algorithms and Data Compression. Curs 2017

Greedy Algorithms and Data Compression. Curs 2017 Greedy Algorithms and Data Compression. Curs 2017 Greedy Algorithms An optimization problem: Given of (S, f ), where S is a set of feasible elements and f : S R is the objective function, find a u S, which

More information

Partitions and Covers

Partitions and Covers University of California, Los Angeles CS 289A Communication Complexity Instructor: Alexander Sherstov Scribe: Dong Wang Date: January 2, 2012 LECTURE 4 Partitions and Covers In previous lectures, we saw

More information

Lecture 12: Feb 16, 2017

Lecture 12: Feb 16, 2017 CS 6170 Computational Topology: Topological Data Analysis Spring 2017 Lecture 12: Feb 16, 2017 Lecturer: Prof Bei Wang University of Utah School of Computing Scribe: Waiming Tai This

More information

9.1 The Square Root Function

9.1 The Square Root Function Section 9.1 The Square Root Function 869 9.1 The Square Root Function In this section we turn our attention to the square root unction, the unction deined b the equation () =. (1) We begin the section

More information

1 Caveats of Parallel Algorithms

1 Caveats of Parallel Algorithms CME 323: Distriuted Algorithms and Optimization, Spring 2015 http://stanford.edu/ reza/dao. Instructor: Reza Zadeh, Matroid and Stanford. Lecture 1, 9/26/2015. Scried y Suhas Suresha, Pin Pin, Andreas

More information

Data selection. Lower complexity bound for sorting

Data selection. Lower complexity bound for sorting Data selection. Lower complexity bound for sorting Lecturer: Georgy Gimel farb COMPSCI 220 Algorithms and Data Structures 1 / 12 1 Data selection: Quickselect 2 Lower complexity bound for sorting 3 The

More information

Generalized Tree Architecture with High-Radix Processing for an SC Polar Decoder

Generalized Tree Architecture with High-Radix Processing for an SC Polar Decoder Generalized Tree Architecture with Hih-Radix Processin or an SC Polar ecoder Tae-Hwan Kim Korea Aerospace University Santa Clara, CA 1 Outline Backround Polar codes SC decodin / decoder architecture Proposed

More information

Disjoint set (Union-Find)

Disjoint set (Union-Find) CS124 Lecture 7 Fall 2018 Disjoit set (Uio-Fid) For Kruskal s algorithm for the miimum spaig tree problem, we foud that we eeded a data structure for maitaiig a collectio of disjoit sets. That is, we eed

More information

Strong Interference and Spectrum Warfare

Strong Interference and Spectrum Warfare Stron Interference and Spectrum Warfare Otilia opescu and Christopher Rose WILAB Ruters University 73 Brett Rd., iscataway, J 8854-86 Email: {otilia,crose}@winlab.ruters.edu Dimitrie C. opescu Department

More information

Cuts & Metrics: Multiway Cut

Cuts & Metrics: Multiway Cut Cuts & Metrics: Multiway Cut Barna Saha April 21, 2015 Cuts and Metrics Multiway Cut Probabilistic Approximation of Metrics by Tree Metric Cuts & Metrics Metric Space: A metric (V, d) on a set of vertices

More information

PHY 133 Lab 1 - The Pendulum

PHY 133 Lab 1 - The Pendulum 3/20/2017 PHY 133 Lab 1 The Pendulum [Stony Brook Physics Laboratory Manuals] Stony Brook Physics Laboratory Manuals PHY 133 Lab 1 - The Pendulum The purpose of this lab is to measure the period of a simple

More information

CS 6110 S16 Lecture 33 Testing Equirecursive Equality 27 April 2016

CS 6110 S16 Lecture 33 Testing Equirecursive Equality 27 April 2016 CS 6110 S16 Lecture 33 Testing Equirecursive Equality 27 April 2016 1 Equirecursive Equality In the equirecursive view of recursive types, types are regular labeled trees, possibly infinite. However, we

More information

Problem Solving as State Space Search

Problem Solving as State Space Search Problem olving as tate pace earch rian. Williams 6.070 pril 5 th, 00 lides adapted from: 6.0 Tomas Lozano Perez, Russell and Norvig IM rian Williams, pring 0 elf-iagnosing Explorers courtesy of JPL rian

More information

Algorithms And Programming I. Lecture 5 Quicksort

Algorithms And Programming I. Lecture 5 Quicksort Algorithms And Programming I Lecture 5 Quicksort Quick Sort Partition set into two using randomly chosen pivot 88 31 25 52 14 98 62 30 23 79 14 31 2530 23 52 88 62 98 79 Quick Sort 14 31 2530 23 52 88

More information

Practice Final Solutions. 1. Consider the following algorithm. Assume that n 1. line code 1 alg(n) { 2 j = 0 3 if (n = 0) { 4 return j

Practice Final Solutions. 1. Consider the following algorithm. Assume that n 1. line code 1 alg(n) { 2 j = 0 3 if (n = 0) { 4 return j Practice Final Solutions 1. Consider the following algorithm. Assume that n 1. line code 1 alg(n) 2 j = 0 3 if (n = 0) 4 return j } 5 else 6 j = 2n+ alg(n 1) 7 return j } } Set up a recurrence relation

More information

Appendix lecture 9: Extra terms.

Appendix lecture 9: Extra terms. Appendi lecture 9: Etra terms The Hyperolic method has een used to prove that d n = log + 2γ + O /2 n This can e used within the Convolution Method to prove Theorem There eists a constant C such that n

More information

(Nearly)-tight bounds on the linearity and contiguity of cographs

(Nearly)-tight bounds on the linearity and contiguity of cographs Bordeaux Graph Workshop 21/11/2012 - Bordeaux (Nearly)-tight bounds on the linearity and contiguity of cographs Christophe Crespelle LI Université de Lyon INRIA hilippe Gambette LIGM Université aris-est

More information

directed weighted graphs as flow networks the Ford-Fulkerson algorithm termination and running time

directed weighted graphs as flow networks the Ford-Fulkerson algorithm termination and running time Network Flow 1 The Maximum-Flow Problem directed weighted graphs as flow networks the Ford-Fulkerson algorithm termination and running time 2 Maximum Flows and Minimum Cuts flows and cuts max flow equals

More information

Relaxed Multiplication Using the Middle Product

Relaxed Multiplication Using the Middle Product Relaxed Multiplication Usin the Middle Product Joris van der Hoeven Département de Mathématiques (bât. 425) Université Paris-Sud 91405 Orsay Cedex France joris@texmacs.or ABSTRACT In previous work, we

More information

Learning Decision Trees

Learning Decision Trees Learning Decision Trees Machine Learning Spring 2018 1 This lecture: Learning Decision Trees 1. Representation: What are decision trees? 2. Algorithm: Learning decision trees The ID3 algorithm: A greedy

More information

On-Line Trajectory Optimization Including Moving Threats and Targets

On-Line Trajectory Optimization Including Moving Threats and Targets AIAA Guidance, Naviation, and Control Conerence and Ehibit 6-9 Auust 00, Providence, Rhode Island AIAA 00-59 On-Line rajector Optimization Includin Movin hreats and arets hannon wi *, Anthon Calise and

More information

CS5371 Theory of Computation. Lecture 9: Automata Theory VII (Pumping Lemma, Non-CFL)

CS5371 Theory of Computation. Lecture 9: Automata Theory VII (Pumping Lemma, Non-CFL) CS5371 Theory of Computation Lecture 9: Automata Theory VII (Pumping Lemma, Non-CFL) Objectives Introduce Pumping Lemma for CFL Apply Pumping Lemma to show that some languages are non-cfl Pumping Lemma

More information

Combinatorial Optimization

Combinatorial Optimization Combinatorial Optimization 2017-2018 1 Maximum matching on bipartite graphs Given a graph G = (V, E), find a maximum cardinal matching. 1.1 Direct algorithms Theorem 1.1 (Petersen, 1891) A matching M is

More information

Functions. Introduction

Functions. Introduction Functions,00 P,000 00 0 y 970 97 980 98 990 99 000 00 00 Fiure Standard and Poor s Inde with dividends reinvested (credit "bull": modiication o work by Prayitno Hadinata; credit "raph": modiication o work

More information

Approximate Voronoi Diagrams

Approximate Voronoi Diagrams CS468, Mon. Oct. 30 th, 2006 Approximate Voronoi Diagrams Presentation by Maks Ovsjanikov S. Har-Peled s notes, Chapters 6 and 7 1-1 Outline Preliminaries Problem Statement ANN using PLEB } Bounds and

More information

Lecture 2: Network Flows 1

Lecture 2: Network Flows 1 Comp 260: Advanced Algorithms Tufts University, Spring 2011 Lecture by: Prof. Cowen Scribe: Saeed Majidi Lecture 2: Network Flows 1 A wide variety of problems, including the matching problems discussed

More information

5. Solve graphically. Express your answer in interval notation.

5. Solve graphically. Express your answer in interval notation. PRECALCULUS GROUP REVIEW FIRST SEMESTER 016 Approximate the followin 1- usin: lo 0.6, lo 5 0.7, and lo 7 0. 9 1. lo lo 5 lo 5.... lo 10. lo 7 4. Find all zeros aleraically ( any complex too). 5 9 4 0.5x

More information

Undirected Graphs. V = { 1, 2, 3, 4, 5, 6, 7, 8 } E = { 1-2, 1-3, 2-3, 2-4, 2-5, 3-5, 3-7, 3-8, 4-5, 5-6 } n = 8 m = 11

Undirected Graphs. V = { 1, 2, 3, 4, 5, 6, 7, 8 } E = { 1-2, 1-3, 2-3, 2-4, 2-5, 3-5, 3-7, 3-8, 4-5, 5-6 } n = 8 m = 11 Undirected Graphs Undirected graph. G = (V, E) V = nodes. E = edges between pairs of nodes. Captures pairwise relationship between objects. Graph size parameters: n = V, m = E. V = {, 2, 3,,,, 7, 8 } E

More information

Analysis of Uninformed Search Methods

Analysis of Uninformed Search Methods nalysis of Uninformed earch Methods rian. Williams 16.410-13 ep 21 st, 2004 lides adapted from: 6.034 Tomas Lozano Perez, Russell and Norvig IM rian Williams, Fall 04 1 ssignments Remember: Problem et

More information

Figure 1: Bayesian network for problem 1. P (A = t) = 0.3 (1) P (C = t) = 0.6 (2) Table 1: CPTs for problem 1. (c) P (E B) C P (D = t) f 0.9 t 0.

Figure 1: Bayesian network for problem 1. P (A = t) = 0.3 (1) P (C = t) = 0.6 (2) Table 1: CPTs for problem 1. (c) P (E B) C P (D = t) f 0.9 t 0. Probabilistic Artiicial Intelligence Problem Set 3 Oct 27, 2017 1. Variable elimination In this exercise you will use variable elimination to perorm inerence on a bayesian network. Consider the network

More information

Mathematical Notation Math Calculus & Analytic Geometry III

Mathematical Notation Math Calculus & Analytic Geometry III Name : Mathematical Notation Math 221 - alculus & Analytic Geometry III Use Word or WordPerect to recreate the ollowing documents. Each article is worth 10 points and can e printed and given to the instructor

More information

CS 61B Asymptotic Analysis Fall 2017

CS 61B Asymptotic Analysis Fall 2017 CS 61B Asymptotic Analysis Fall 2017 1 More Running Time Give the worst case and best case running time in Θ( ) notation in terms of M and N. (a) Assume that slam() Θ(1) and returns a boolean. 1 public

More information

Worst Case Instances for Maximum Clique Algorithms and How to Avoid Them

Worst Case Instances for Maximum Clique Algorithms and How to Avoid Them Worst Case Instances for Maximum Clique Algorithms and How to Avoid Them Alexandre Prusch Züge Renato Carmo Universidade Federal do Paraná Programa de Pós-Graduação em Informática Grupo de Pesquisa em

More information

5.1 Learning using Polynomial Threshold Functions

5.1 Learning using Polynomial Threshold Functions CS 395T Computational Learning Theory Lecture 5: September 17, 2007 Lecturer: Adam Klivans Scribe: Aparajit Raghavan 5.1 Learning using Polynomial Threshold Functions 5.1.1 Recap Definition 1 A function

More information

5. Network Analysis. 5.1 Introduction

5. Network Analysis. 5.1 Introduction 5. Network Analysis 5.1 Introduction With the continued rowth o this country as it enters the next century comes the inevitable increase in the number o vehicles tryin to use the already overtaxed transportation

More information

Supplementary material for Continuous-action planning for discounted infinite-horizon nonlinear optimal control with Lipschitz values

Supplementary material for Continuous-action planning for discounted infinite-horizon nonlinear optimal control with Lipschitz values Supplementary material or Continuous-action planning or discounted ininite-horizon nonlinear optimal control with Lipschitz values List o main notations x, X, u, U state, state space, action, action space,

More information

5. Partitions and Relations Ch.22 of PJE.

5. Partitions and Relations Ch.22 of PJE. 5. Partitions and Relations Ch. of PJE. We now generalize the ideas of congruence classes of Z to classes of any set X. The properties of congruence classes that we start with here are that they are disjoint

More information

(K2) For sum of the potential differences around any cycle is equal to zero. r uv resistance of {u, v}. [In other words, V ir.]

(K2) For sum of the potential differences around any cycle is equal to zero. r uv resistance of {u, v}. [In other words, V ir.] Lectures 16-17: Random walks on graphs CSE 525, Winter 2015 Instructor: James R. Lee 1 Random walks Let G V, E) be an undirected graph. The random walk on G is a Markov chain on V that, at each time step,

More information

Aditya Bhaskara CS 5968/6968, Lecture 1: Introduction and Review 12 January 2016

Aditya Bhaskara CS 5968/6968, Lecture 1: Introduction and Review 12 January 2016 Lecture 1: Introduction and Review We begin with a short introduction to the course, and logistics. We then survey some basics about approximation algorithms and probability. We also introduce some of

More information

On shredders and vertex connectivity augmentation

On shredders and vertex connectivity augmentation On shredders and vertex connectivity augmentation Gilad Liberman The Open University of Israel giladliberman@gmail.com Zeev Nutov The Open University of Israel nutov@openu.ac.il Abstract We consider the

More information

Divide-and-Conquer. Reading: CLRS Sections 2.3, 4.1, 4.2, 4.3, 28.2, CSE 6331 Algorithms Steve Lai

Divide-and-Conquer. Reading: CLRS Sections 2.3, 4.1, 4.2, 4.3, 28.2, CSE 6331 Algorithms Steve Lai Divide-and-Conquer Reading: CLRS Sections 2.3, 4.1, 4.2, 4.3, 28.2, 33.4. CSE 6331 Algorithms Steve Lai Divide and Conquer Given an instance x of a prolem, the method works as follows: divide-and-conquer

More information

Introduction to Algorithms

Introduction to Algorithms Introduction to Algorithms, Lecture 5 // Introduction to Algorithms 6.46J/.4J LECTURE Shortest Paths I Properties o shortest paths Dijkstra s Correctness Analysis Breadth-irst Pro. Manolis Kellis March,

More information

CS21 Decidability and Tractability

CS21 Decidability and Tractability CS21 Decidability and Tractability Lecture 18 February 16, 2018 February 16, 2018 CS21 Lecture 18 1 Outline the complexity class NP 3-SAT is NP-complete NP-complete problems: independent set, vertex cover,

More information

Energizing Math with Engineering Applications

Energizing Math with Engineering Applications Enerizin Math with Enineerin Applications Understandin the Math behind Launchin a Straw-Rocket throuh the use of Simulations. Activity created by Ira Rosenthal (rosenthi@palmbeachstate.edu) as part of

More information

CSE 326: Data Structures NP Completeness

CSE 326: Data Structures NP Completeness Announcements S 326: ata Structures NP ompleteness rian urless Spring 2008 enchmarking for project 3 due tonight Last homework due on riday at beginning of class inal next Thursday Scheduled for 8:30,

More information

Tutorial 4. Dynamic Set: Amortized Analysis

Tutorial 4. Dynamic Set: Amortized Analysis Tutorial 4 Dynamic Set: Amortized Analysis Review Binary tree Complete binary tree Full binary tree 2-tree P115 Unlike common binary tree, the base case is not an empty tree, but a external node Heap Binary

More information

1999 AAPT PHYSICS OLYMPIAD

1999 AAPT PHYSICS OLYMPIAD 1999 AAPT PHYSICS OLYMPIAD Entia non multiplicanda sunt praeter necessitatem 1999 MULTIPLE CHOICE SCREENING TEST 30 QUESTIONS - 40 MINUTES INSTRUCTIONS DO NOT OPEN THIS TEST UNTIL YOU ARE TOLD TO BEGIN

More information

Exponential and Logarithmic. Functions CHAPTER The Algebra of Functions; Composite

Exponential and Logarithmic. Functions CHAPTER The Algebra of Functions; Composite CHAPTER 9 Exponential and Logarithmic Functions 9. The Algebra o Functions; Composite Functions 9.2 Inverse Functions 9.3 Exponential Functions 9.4 Exponential Growth and Decay Functions 9.5 Logarithmic

More information

Categories and Quantum Informatics: Monoidal categories

Categories and Quantum Informatics: Monoidal categories Cateories and Quantum Inormatics: Monoidal cateories Chris Heunen Sprin 2018 A monoidal cateory is a cateory equipped with extra data, describin how objects and morphisms can be combined in parallel. This

More information

Randomized Sorting Algorithms Quick sort can be converted to a randomized algorithm by picking the pivot element randomly. In this case we can show th

Randomized Sorting Algorithms Quick sort can be converted to a randomized algorithm by picking the pivot element randomly. In this case we can show th CSE 3500 Algorithms and Complexity Fall 2016 Lecture 10: September 29, 2016 Quick sort: Average Run Time In the last lecture we started analyzing the expected run time of quick sort. Let X = k 1, k 2,...,

More information

Physics 5153 Classical Mechanics. Solution by Quadrature-1

Physics 5153 Classical Mechanics. Solution by Quadrature-1 October 14, 003 11:47:49 1 Introduction Physics 5153 Classical Mechanics Solution by Quadrature In the previous lectures, we have reduced the number o eective degrees o reedom that are needed to solve

More information

1 Matroid intersection

1 Matroid intersection CS 369P: Polyhedral techniques in combinatorial optimization Instructor: Jan Vondrák Lecture date: October 21st, 2010 Scribe: Bernd Bandemer 1 Matroid intersection Given two matroids M 1 = (E, I 1 ) and

More information

4.3. Solving Friction Problems. Static Friction Problems. Tutorial 1 Static Friction Acting on Several Objects. Sample Problem 1.

4.3. Solving Friction Problems. Static Friction Problems. Tutorial 1 Static Friction Acting on Several Objects. Sample Problem 1. Solvin Friction Problems Sometimes friction is desirable and we want to increase the coefficient of friction to help keep objects at rest. For example, a runnin shoe is typically desined to have a lare

More information

Get the frictional force from the normal force. Use dynamics to get the normal force.

Get the frictional force from the normal force. Use dynamics to get the normal force. . L F n µ k L =00 t µ k = 0.60 = 0 o = 050 lb F n +y +x x = sin y = cos = µf n Is the initial elocity o the car reater than 30 mph? Approach: Use conseration o enery. System: car Initial time: beore you

More information

Complexity Theory: The P vs NP question

Complexity Theory: The P vs NP question The $1M question Complexity Theory: The P vs NP question Lecture 28 (December 1, 2009) The Clay Mathematics Institute Millenium Prize Problems 1. Birch and Swinnerton-Dyer Conjecture 2. Hodge Conjecture

More information

More Approximation Algorithms

More Approximation Algorithms CS 473: Algorithms, Spring 2018 More Approximation Algorithms Lecture 25 April 26, 2018 Most slides are courtesy Prof. Chekuri Ruta (UIUC) CS473 1 Spring 2018 1 / 28 Formal definition of approximation

More information

APPROXIMATION ALGORITHMS RESOLUTION OF SELECTED PROBLEMS 1

APPROXIMATION ALGORITHMS RESOLUTION OF SELECTED PROBLEMS 1 UNIVERSIDAD DE LA REPUBLICA ORIENTAL DEL URUGUAY IMERL, FACULTAD DE INGENIERIA LABORATORIO DE PROBABILIDAD Y ESTADISTICA APPROXIMATION ALGORITHMS RESOLUTION OF SELECTED PROBLEMS 1 STUDENT: PABLO ROMERO

More information

Factorized Relational Databases Olteanu and Závodný, University of Oxford

Factorized Relational Databases   Olteanu and Závodný, University of Oxford November 8, 2013 Database Seminar, U Washington Factorized Relational Databases http://www.cs.ox.ac.uk/projects/fd/ Olteanu and Závodný, University of Oxford Factorized Representations of Relations Cust

More information

Causal Bayesian Networks

Causal Bayesian Networks Causal Bayesian Networks () Ste7 (2) (3) Kss Fus3 Ste2 () Fiure : Simple Example While Bayesian networks should typically be viewed as acausal, it is possible to impose a causal interpretation on these

More information

Contents Lecture 4. Greedy graph algorithms Dijkstra s algorithm Prim s algorithm Kruskal s algorithm Union-find data structure with path compression

Contents Lecture 4. Greedy graph algorithms Dijkstra s algorithm Prim s algorithm Kruskal s algorithm Union-find data structure with path compression Contents Lecture 4 Greedy graph algorithms Dijkstra s algorithm Prim s algorithm Kruskal s algorithm Union-find data structure with path compression Jonas Skeppstedt (jonasskeppstedt.net) Lecture 4 2018

More information

23. Cutting planes and branch & bound

23. Cutting planes and branch & bound CS/ECE/ISyE 524 Introduction to Optimization Spring 207 8 23. Cutting planes and branch & bound ˆ Algorithms for solving MIPs ˆ Cutting plane methods ˆ Branch and bound methods Laurent Lessard (www.laurentlessard.com)

More information

ICS 252 Introduction to Computer Design

ICS 252 Introduction to Computer Design ICS 252 fall 2006 Eli Bozorgzadeh Computer Science Department-UCI References and Copyright Textbooks referred [Mic94] G. De Micheli Synthesis and Optimization of Digital Circuits McGraw-Hill, 1994. [CLR90]

More information

This relationship is known as the ideal gas law and is mathematically described with the formula below:

This relationship is known as the ideal gas law and is mathematically described with the formula below: Chemistry 20 Ideal as law If we combine all the information contained in Boyle s, Charles and Avoadro s laws, we can derive an expression that describes the temperature, pressure and volume of a as. This

More information

REVIEW: Going from ONE to TWO Dimensions with Kinematics. Review of one dimension, constant acceleration kinematics. v x (t) = v x0 + a x t

REVIEW: Going from ONE to TWO Dimensions with Kinematics. Review of one dimension, constant acceleration kinematics. v x (t) = v x0 + a x t Lecture 5: Projectile motion, uniform circular motion 1 REVIEW: Goin from ONE to TWO Dimensions with Kinematics In Lecture 2, we studied the motion of a particle in just one dimension. The concepts of

More information

The Ideal thermodynamic cycle for gas liquefaction is impractical and hence modified cycles are proposed.

The Ideal thermodynamic cycle for gas liquefaction is impractical and hence modified cycles are proposed. Earlier Lecture The Ideal thermodynamic cycle or as liqueaction is impractical and hence modiied cycles are proposed. An Ideal cycle is used as a benchmark and in eect, dierent ratios and unctions are

More information

Preliminaries. Graphs. E : set of edges (arcs) (Undirected) Graph : (i, j) = (j, i) (edges) V = {1, 2, 3, 4, 5}, E = {(1, 3), (3, 2), (2, 4)}

Preliminaries. Graphs. E : set of edges (arcs) (Undirected) Graph : (i, j) = (j, i) (edges) V = {1, 2, 3, 4, 5}, E = {(1, 3), (3, 2), (2, 4)} Preliminaries Graphs G = (V, E), V : set of vertices E : set of edges (arcs) (Undirected) Graph : (i, j) = (j, i) (edges) 1 2 3 5 4 V = {1, 2, 3, 4, 5}, E = {(1, 3), (3, 2), (2, 4)} 1 Directed Graph (Digraph)

More information