Lecture 19: Topological sort Part 1: Problem and math basis. Topological sort. The problem. Why we are doing this!
|
|
- Jodie Welch
- 5 years ago
- Views:
Transcription
1 Chair of Software Engineering Einführung in die Programmierung Introduction to Programming Prof. r. Bertrand Meyer October 006 February 007 Lecture 9: Topological sort Part : Problem and math basis Intro. to Programming, lecture 9: Topological Sort I Intro. to Programming, lecture 9: Topological Sort I Topological sort by Caran d Ache From a given partial order, produce a compatible total order 3 Intro. to Programming, lecture 9: Topological Sort I The problem 4 Why we are doing this! From a given partial order, produce a compatible total order ¾Very Partial order: ordering constraints between elements of a set, e.g. ¾ Remove the dishes before discussing politics ¾ Walk to Üetliberg before lunch ¾ Take your medicine before lunch ¾ Finish lunch before removing dishes Total order: sequence including all elements of set Compatible: the sequence respects all ordering constraints ¾ Üetliberg, Medicine, Lunch, ishes, Politics : OK ¾ Medicine, Üetliberg, Lunch, ishes, Politics : OK ¾ Politics, Medicine, Lunch, ishes, Üetliberg : not OK Intro. to Programming, lecture 9: Topological Sort I common problem in many different areas efficient, non-trivial algorithm ¾Illustration of many algorithmic techniques ¾Illustration of data structures, complexity (big-oh notation), and other topics of last lecture ¾Illustration of software engineering techniques: from algorithm to component with useful API ¾Opportunity to learn or rediscover important mathematical concepts: binary relations (order relations in particular) and their properties ¾It s just beautiful! Today: problem and math basis Next time: detailed algorithm and component ¾Interesting, 5 Intro. to Programming, lecture 9: Topological Sort I 6
2 Reading assignment for next Monday Topological sort: example uses Touch of Class, chapter on topological sort: 7 From a dictionary, produce a list of definitions such that no word occurs prior to its definition Produce a complete schedule for carrying out a set of tasks, subject to ordering constraints (This is done for scheduling maintenance tasks for industrial tasks, often with thousands of constraints) Produce a version of a class with the features reordered so that no feature call appears before the feature s declaration Intro. to Programming, lecture 9: Topological Sort I 7 Intro. to Programming, lecture 9: Topological Sort I 8 Rectangles with overlap constraints Rectangles with overlap constraints Constraints: [B, A], [, A], [A, C], [B, ], [, C] Constraints: [B, A], [, A], [A, C], [B, ], [, C] Possible solution: B E A C B A C E B A C E Intro. to Programming, lecture 9: Topological Sort I 9 Intro. to Programming, lecture 9: Topological Sort I 0 The problem From a given partial order, produce a compatible total order Pictured as a graph Üetliberg Partial order: ordering constraints between elements of a set, e.g. Remove the dishes before discussing politics Walk to Üetliberg before lunch Take your medicine before lunch Finish lunch before removing dishes Total order: sequence including all elements of set Compatible: the sequence respects all ordering constraints Üetliberg, Medicine, Lunch, ishes, Politics : OK Medicine, Üetliberg, Lunch, ishes, Politics : OK Politics, Medicine, Lunch, ishes, Üetliberg : not OK Medicine Lunch ishes Politics Remove the dishes before discussing politics Walk to Üetliberg before lunch Take your medicine before lunch Finish lunch before removing dishes Intro. to Programming, lecture 9: Topological Sort I Intro. to Programming, lecture 9: Topological Sort I
3 (brother Sometimes there is no solution Overall structure () Introducing recursion requires that students know about stacks You must discuss abstract data types before introducing stacks Abstract data types rely on recursion The constraints introduce a cycle Given: A type G A set of elements of type G A set of constraints between these elements Required: An enumeration of the elements, in an order compatible with the constraints class ORERABLE [G] feature elements: LIST [G ] constraints: LIST [TUPLE [G, G ]] topsort : LIST [G ] is... ensure compatible (Result, constraints) end Intro. to Programming, lecture 9: Topological Sort I 3 Intro. to Programming, lecture 9: Topological Sort I 4 Some mathematical background... Binary relation on a set Any property that either holds or doesn t hold between two elements of a set On a set PERSON of persons, example relations are: mother : a mother b holds if and only if a is the mother of b father: child : sister: sibling : or sister) Notation: a r b to express that r holds of a and b. Note: relation names will appear in green Intro. to Programming, lecture 9: Topological Sort I 5 Intro. to Programming, lecture 9: Topological Sort I 6 Example: the before relation Some special relations on a set X Remove the dishes before discussing politics Walk to Üetliberg before lunch Take your medicine before lunch Finish lunch before removing dishes The set of interest: Tasks = {Politics, Lunch, Medicine, ishes, Üetliberg} universal [X ]: holds between any two elements of X id [X ]: holds between every element of X and itself empty [X ]: holds between no elements of X The constraining relation: ishes before Politics Üetliberg before Lunch Medicine before Lunch Lunch before ishes Intro. to Programming, lecture 9: Topological Sort I 7 Intro. to Programming, lecture 9: Topological Sort I 8 3
4 Relations: a more precise mathematical view We consider a relation r on a set P as: A set of pairs in P x P, containing all the pairs [x, y] such that x r y. Then x r y simply means that [x, y] r See examples on next slide Example: the before relation Remove dishes before discussing politics Walk to Üetliberg before lunch Take your medicine before lunch Finish lunch before removing dishes The set of interest: elements = {Politics, Lunch, Medicine, ishes, Üetliberg} The constraining relation: before = {[ishes, Politics], [Üetliberg, Lunch], [Medicine, Lunch], [Lunch, ishes]} Intro. to Programming, lecture 9: Topological Sort I 9 Intro. to Programming, lecture 9: Topological Sort I 0 Using ordinary set operators spouse = wife husband sibling = sister brother id [Person] sister sibling father ancestor universal [X ] = X x X (cartesian product) empty [X ] = Possible properties of a relation (On a set X. All definitions must hold for every a, b, c... X.) Total*: (a b) ((a r b) (b r a)) Reflexive: a r a Asymmetric: not ((a r b) (b r a)) Transitive: (a r b) (b r c) a r c *efinition of total is specific to this discussion (there is no standard definition). The other terms are standard. Intro. to Programming, lecture 9: Topological Sort I Intro. to Programming, lecture 9: Topological Sort I Examples (on a set of persons) Total order relation (strict) sibling sister family_head mother Reflexive, symmetric, transitive Symmetric, irreflexive Reflexive, antisymmetric (a family_head b means a is the head of b s family, with one head per family) Asymmetric, irreflexive Total: (a b) (a r b) (b r a) Reflexive: a r a Asymmetric: not ((a r b) (b r a)) Transitive: (a r b) (b r c) a r c Intro. to Programming, lecture 9: Topological Sort I 3 Relation is strict total order if: Total Irreflexive Transitive Asymmetric: not ((a r b) (b r a)) Transitive: (a r b) (b r c) a r c Example: less than < on natural numbers < 0 <, 0 < 3, 0 < 4,... < < 3 < 4,... < 3 < 4, Intro. to Programming, lecture 9: Topological Sort I 4 4
5 Theorem Total order relation (strict) A strict (total) order is asymmetric Relation is strict total order if: Total Irreflexive Transitive Asymmetric: not ((a r b) (b r a)) Transitive: (a r b) (b r c) a r c Theorem: A strict total order is asymmetric Intro. to Programming, lecture 9: Topological Sort I 5 Intro. to Programming, lecture 9: Topological Sort I 6 Total order relation (non-strict) Total order relation (strict) Relation is non-strict total order if: Total Reflexive Transitive Antisymmetric Transitive:(a r b) (b r c) a r c Relation is strict total order if: Total Irreflexive Transitive Transitive:(a r b) (b r c) a r c Example: less than or equal on natural numbers , 0, 0 3, 0 4,... 0, 0 3, 0 4,..., 3, 4,... 3, 4, Intro. to Programming, lecture 9: Topological Sort I 7 Intro. to Programming, lecture 9: Topological Sort I 8 Partial order relation (strict) Theorems Relation is strict partial order if: Total Irreflexive Transitive Transitive:(a r b) (b r c) a r c A strict (total) partial order is asymmetric y 0 [0, ] a [, ] b 3 [3, 0] c [4, ] d x Example: relation between points in a plane: p < q if both x p < x q y p < y q A total order is a partial order ( partial order really means possibly partial) Intro. to Programming, lecture 9: Topological Sort I 9 Intro. to Programming, lecture 9: Topological Sort I 30 5
6 y Example partial order Possible topological sorts y [0, ] a [, ] b [4, ] d p < q if both x p < x q y p < y q a b d 0 3 [3, 0] c 0 3 c Here the following hold: No link between a and c, b and c: a < b a < d c < d e.g. neither a < c nor c < a a < b a < d c < d Intro. to Programming, lecture 9: Topological Sort I 3 Intro. to Programming, lecture 9: Topological Sort I 3 Topological sort understood 0 y a b a < b a < d 3 c c < d d Here the relation < is: {[a, b], [a, d], [c, d]} One of the solutions is: a, b, c, d We are looking for a total order relation t such that < t Final statement of topological sort problem From a given partial order, produce a compatible total order where: A partial order p is compatible with a total order t if and only if p t Intro. to Programming, lecture 9: Topological Sort I 33 Intro. to Programming, lecture 9: Topological Sort I 34 From constraints to partial orders Powers and transitive closure of a relation Is a relation defined by a set of constraints, such as constraints = {[ishes, Politics], [Üetliberg, Lunch], [Medicine, Lunch], [Lunch, ishes]} always a partial order? r i + = r i ; r where ; is composition Ü L M P Üetliberg Medicine Lunch ishes Politics Transitive closure r + = r r... always transitive r r r 3 Intro. to Programming, lecture 9: Topological Sort I 35 Intro. to Programming, lecture 9: Topological Sort I 36 6
7 Reflexive transitive closure r 0 = id [X ] where X is the underlying set r i + = r i ; r where ; is composition Acyclic relation A relation r on a set X is acyclic if and only if: r + id [X ] = Ü M L P Ü M L P Transitive closure r + = r r... always transitive Reflexive transitive closure: r = r 0 r r... always transitive and reflexive r 0 r r r 3 Intro. to Programming, lecture 9: Topological Sort I 37 before + id [X] Intro. to Programming, lecture 9: Topological Sort I 38 Acyclic relations and partial orders Theorems: Any (strict) order relation is acyclic. A relation is acyclic if and only if its transitive closure is a (strict) order. From constraints to partial orders The partial order of interest is before + before = {[ishes, Politics], [Üetliberg, Lunch], [Medicine, Lunch], [Lunch, ishes]} (Also: if and only if its reflexive transitive closure is a nonstrict partial order) Üetliberg Medicine Lunch ishes Politics Intro. to Programming, lecture 9: Topological Sort I 39 Intro. to Programming, lecture 9: Topological Sort I 40 Back to software... The basic algorithm idea p q r t s v u w topsort Intro. to Programming, lecture 9: Topological Sort I 4 Intro. to Programming, lecture 9: Topological Sort I 4 7
8 What we have seen The topological sort problem and its applications Mathematical background: Relations as sets of pairs Properties of relations Order relations: partial/total, strict/nonstrict Transitive, reflexive-transitive closures The relation between acyclic and order relations The basic idea of topological sort Reading assignment for next Monday Touch of Class, chapter on topological sort: 7 Next: how to do it for Efficient operation (O (m+n) for m constraints & n items) Good software engineering: effective API Intro. to Programming, lecture 9: Topological Sort I 43 Intro. to Programming, lecture 9: Topological Sort I 44 End of lecture 9 Intro. to Programming, lecture 9: Topological Sort I 45 8
Relations, Equivalence Relations, and Partial Orders
Massachusetts Institute of Technology Lecture 6 6.042J/18.062J: Mathematics for Computer Science February 17, 2000 Professors David Karger and Nancy Lynch Relations, Equivalence Relations, and Partial
More information1. Represent each of these relations on {1, 2, 3} with a matrix (with the elements of this set listed in increasing order).
Exercises Exercises 1. Represent each of these relations on {1, 2, 3} with a matrix (with the elements of this set listed in increasing order). a) {(1, 1), (1, 2), (1, 3)} b) {(1, 2), (2, 1), (2, 2), (3,
More informationRelations I. Margaret M. Fleck. 7 November 2008
Relations I Margaret M. Fleck 7 November 2008 This lecture covers relations and basic properties of relations, which is most of section 8.1 of Rosen. 1 Announcements Model solutions for the second midterm
More information10/11/2018. Partial Orderings. Partial Orderings. Partial Orderings. Partial Orderings. Partial Orderings. Partial Orderings
Sometimes, relations define an order on the elements in a set. Definition: A relation R on a set S is called a partial ordering or partial order if it is reflexive, antisymmetric, and transitive. A set
More informationAntisymmetric Relations. Definition A relation R on A is said to be antisymmetric
Antisymmetric Relations Definition A relation R on A is said to be antisymmetric if ( a, b A)(a R b b R a a = b). The picture for this is: Except For Example The relation on R: if a b and b a then a =
More informationOntological Modeling: Part 8
Ontological Modeling: Part 8 Terry Halpin LogicBlox and INTI International University This is the eighth in a series of articles on ontology-based approaches to modeling. The main focus is on popular ontology
More informationRelations. We have seen several types of abstract, mathematical objects, including propositions, predicates, sets, and ordered pairs and tuples.
Relations We have seen several types of abstract, mathematical objects, including propositions, predicates, sets, and ordered pairs and tuples. Relations use ordered tuples to represent relationships among
More informationWeek 7 Prolog overview
Week 7 Prolog overview A language designed for A.I. Logic programming paradigm Programmer specifies relationships among possible data values. User poses queries. What data value(s) will make this predicate
More informationCS:5810 Formal Methods in Software Engineering
CS:5810 Formal Methods in Software Engineering Introduction to Alloy Part 1 Copyright 2001-17, Matt Dwyer, John Hatcliff, Rod Howell, Laurence Pilard, and Cesare Tinelli. Created by Cesare Tinelli and
More informationA set with only one member is called a SINGLETON. A set with no members is called the EMPTY SET or 2 N
Mathematical Preliminaries Read pages 529-540 1. Set Theory 1.1 What is a set? A set is a collection of entities of any kind. It can be finite or infinite. A = {a, b, c} N = {1, 2, 3, } An entity is an
More informationCHAPTER 3 FUZZY RELATION and COMPOSITION
CHAPTER 3 FUZZY RELATION and COMPOSITION Crisp relation! Definition (Product set) Let A and B be two non-empty sets, the prod uct set or Cartesian product A B is defined as follows, A B = {(a, b) a A,
More informationPower Set of a set and Relations
Power Set of a set and Relations 1 Power Set (1) Definition: The power set of a set S, denoted P(S), is the set of all subsets of S. Examples Let A={a,b,c}, P(A)={,{a},{b},{c},{a,b},{b,c},{a,c},{a,b,c}}
More informationMath 187 Sample Test II Questions
Math 187 Sample Test II Questions Dr. Holmes October 2, 2008 These are sample questions of kinds which might appear on Test II. There is no guarantee that all questions on the test will look like these!
More informationSemantics via Syntax. f (4) = if define f (x) =2 x + 55.
1 Semantics via Syntax The specification of a programming language starts with its syntax. As every programmer knows, the syntax of a language comes in the shape of a variant of a BNF (Backus-Naur Form)
More informationContainers and genericity. A standardized naming scheme. Cursor properties. Lists. Adding a cell. A specific implementation: (singly) linked lists
Topics for this lecture Chair of Software Engineering Einführung in die Programmierung Introduction to Programming Containers and genericity Container operations Prof. Dr. Bertrand Meyer Lists October
More informationSlides for Faculty Oxford University Press All rights reserved.
Oxford University Press 2013 Slides for Faculty Assistance Preliminaries Author: Vivek Kulkarni vivek_kulkarni@yahoo.com Outline Following topics are covered in the slides: Basic concepts, namely, symbols,
More informationDDS Dynamic Search Trees
DDS Dynamic Search Trees 1 Data structures l A data structure models some abstract object. It implements a number of operations on this object, which usually can be classified into l creation and deletion
More informationCS2 Algorithms and Data Structures Note 10. Depth-First Search and Topological Sorting
CS2 Algorithms and Data Structures Note 10 Depth-First Search and Topological Sorting In this lecture, we will analyse the running time of DFS and discuss a few applications. 10.1 A recursive implementation
More informationEinführung in die Programmierung Introduction to Programming
Chair of Software Engineering Einführung in die Programmierung Introduction to Programming Prof. Dr. Bertrand Meyer Lecture 14: Container Data Structures Topics for this lecture Containers and genericity
More informationEinführung in die Programmierung Introduction to Programming
Chair of Software Engineering Einführung in die Programmierung Introduction to Programming Prof. Dr. Bertrand Meyer Lecture 3: Dealing with Objects II Programming languages The programming language is
More informationLecture 21: Undo/Redo
Chair of Software Engineering Einführung in die Programmierung Introduction to Programming Prof. Dr. Bertrand Meyer October 2006 February 2007 Lecture 21: Undo/Redo 2 Further reference Chapter 21 of my
More informationLogic and Discrete Mathematics. Section 2.5 Equivalence relations and partitions
Logic and Discrete Mathematics Section 2.5 Equivalence relations and partitions Slides version: January 2015 Equivalence relations Let X be a set and R X X a binary relation on X. We call R an equivalence
More informationintroduction to Programming in C Department of Computer Science and Engineering Lecture No. #40 Recursion Linear Recursion
introduction to Programming in C Department of Computer Science and Engineering Lecture No. #40 Recursion Linear Recursion Today s video will talk about an important concept in computer science which is
More informationIntroduction to Sets and Logic (MATH 1190)
Introduction to Sets and Logic () Instructor: Email: shenlili@yorku.ca Department of Mathematics and Statistics York University Dec 4, 2014 Outline 1 2 3 4 Definition A relation R from a set A to a set
More informationData Structures and Algorithms Dr. Naveen Garg Department of Computer Science and Engineering Indian Institute of Technology, Delhi
Data Structures and Algorithms Dr. Naveen Garg Department of Computer Science and Engineering Indian Institute of Technology, Delhi Lecture 20 Priority Queues Today we are going to look at the priority
More informationContents of Lecture 2
Contents of Lecture Dominance relation An inefficient and simple algorithm to compute dominance Immediate dominators Dominator tree Jonas Skeppstedt (js@cs.lth.se) Lecture / Definition of Dominance Consider
More informationDirected Graphs (II) Hwansoo Han
Directed Graphs (II) Hwansoo Han Traversals of Directed Graphs To solve many problems dealing with digraphs, we need to visit vertexes and arcs in a systematic way Depth-first search (DFS) A generalization
More informationCS 361 Data Structures & Algs Lecture 15. Prof. Tom Hayes University of New Mexico
CS 361 Data Structures & Algs Lecture 15 Prof. Tom Hayes University of New Mexico 10-12-2010 1 Last Time Identifying BFS vs. DFS trees Can they be the same? Problems 3.6, 3.9, 3.2 details left as homework.
More informationNotation Index. Probability notation. (there exists) (such that) Fn-4 B n (Bell numbers) CL-27 s t (equivalence relation) GT-5.
Notation Index (there exists) (for all) Fn-4 Fn-4 (such that) Fn-4 B n (Bell numbers) CL-27 s t (equivalence relation) GT-5 ( n ) k (binomial coefficient) CL-15 ( n m 1,m 2,...) (multinomial coefficient)
More informationLecture 22 Tuesday, April 10
CIS 160 - Spring 2018 (instructor Val Tannen) Lecture 22 Tuesday, April 10 GRAPH THEORY Directed Graphs Directed graphs (a.k.a. digraphs) are an important mathematical modeling tool in Computer Science,
More informationMATH 22 MORE ABOUT FUNCTIONS. Lecture M: 10/14/2003. Form follows function. Louis Henri Sullivan
MATH 22 Lecture M: 10/14/2003 MORE ABOUT FUNCTIONS Form follows function. Louis Henri Sullivan This frightful word, function, was born under other skies than those I have loved. Le Corbusier D ora innanzi
More informationInteger Partition Poset
Integer Partition Poset Teena Carroll St. Norbert College Presented at the Clemson REU Summer 2010 Integer Partitions Given an integer, how can we break it down into the sum of positive integers? ex: n=5
More informationConceptual modeling of entities and relationships using Alloy
Conceptual modeling of entities and relationships using Alloy K. V. Raghavan Indian Institute of Science, Bangalore Conceptual modeling What is it? Capture requirements, other essential aspects of software
More informationNotation Index 9 (there exists) Fn-4 8 (for all) Fn-4 3 (such that) Fn-4 B n (Bell numbers) CL-25 s ο t (equivalence relation) GT-4 n k (binomial coef
Notation 9 (there exists) Fn-4 8 (for all) Fn-4 3 (such that) Fn-4 B n (Bell numbers) CL-25 s ο t (equivalence relation) GT-4 n k (binomial coefficient) CL-14 (multinomial coefficient) CL-18 n m 1 ;m 2
More informationER modeling. Lecture 4
ER modeling Lecture 4 1 Copyright 2007 STI - INNSBRUCK Today s lecture ER modeling Slides based on Introduction to Entity-relationship modeling at http://www.inf.unibz.it/~franconi/teaching/2000/ct481/er-modelling/
More informationWhat Is A Relation? Example. is a relation from A to B.
3.3 Relations What Is A Relation? Let A and B be nonempty sets. A relation R from A to B is a subset of the Cartesian product A B. If R A B and if (a, b) R, we say that a is related to b by R and we write
More informationCOMP Analysis of Algorithms & Data Structures
COMP 3170 - Analysis of Algorithms & Data Structures Shahin Kamali Topic 1 - Introductions University of Manitoba Picture is from the cover of the textbook CLRS. COMP 3170 - Analysis of Algorithms & Data
More informationCISC 1400 Discrete Structures
CISC 1400 Discrete Structures Chapter 4 Relations CISC1400 Yanjun Li 1 1 Relation A relation is a connection between objects in one set and objects in another set (possibly the same set). age is a relation
More informationSets MAT231. Fall Transition to Higher Mathematics. MAT231 (Transition to Higher Math) Sets Fall / 31
Sets MAT231 Transition to Higher Mathematics Fall 2014 MAT231 (Transition to Higher Math) Sets Fall 2014 1 / 31 Outline 1 Sets Introduction Cartesian Products Subsets Power Sets Union, Intersection, Difference
More informationDiscrete mathematics
Discrete mathematics Petr Kovář petr.kovar@vsb.cz VŠB Technical University of Ostrava DiM 470-2301/02, Winter term 2018/2019 About this file This file is meant to be a guideline for the lecturer. Many
More informationSFU CMPT Lecture: Week 9
SFU CMPT-307 2008-2 1 Lecture: Week 9 SFU CMPT-307 2008-2 Lecture: Week 9 Ján Maňuch E-mail: jmanuch@sfu.ca Lecture on July 8, 2008, 5.30pm-8.20pm SFU CMPT-307 2008-2 2 Lecture: Week 9 Binary search trees
More informationCSE 373 OCTOBER 11 TH TRAVERSALS AND AVL
CSE 373 OCTOBER 11 TH TRAVERSALS AND AVL MINUTIAE Feedback for P1p1 should have gone out before class Grades on canvas tonight Emails went to the student who submitted the assignment If you did not receive
More informationCrossing bridges. Crossing bridges Great Ideas in Theoretical Computer Science. Lecture 12: Graphs I: The Basics. Königsberg (Prussia)
15-251 Great Ideas in Theoretical Computer Science Lecture 12: Graphs I: The Basics February 22nd, 2018 Crossing bridges Königsberg (Prussia) Now Kaliningrad (Russia) Is there a way to walk through the
More informationStrongly connected: A directed graph is strongly connected if every pair of vertices are reachable from each other.
Directed Graph In a directed graph, each edge (u, v) has a direction u v. Thus (u, v) (v, u). Directed graph is useful to model many practical problems (such as one-way road in traffic network, and asymmetric
More informationToday. Types of graphs. Complete Graphs. Trees. Hypercubes.
Today. Types of graphs. Complete Graphs. Trees. Hypercubes. Complete Graph. K n complete graph on n vertices. All edges are present. Everyone is my neighbor. Each vertex is adjacent to every other vertex.
More information1. Relations 2. Equivalence relations 3. Modular arithmetics. ! Think of relations as directed graphs! xry means there in an edge x!
2 Today s Topics: CSE 20: Discrete Mathematics for Computer Science Prof. Miles Jones 1. Relations 2. 3. Modular arithmetics 3 4 Relations are graphs! Think of relations as directed graphs! xry means there
More informationCS 173 Lecture 18: Relations on a Set
CS 173 Lecture 18: Relations on a Set José Meseguer University of Illinois at Urbana-Champaign 1 Relations on a Set 1.1 The Data Type RelpAq Many algorithms, in particular the so-called graph algorithms,
More information4/10/2018. Relational Algebra (RA) 1. Selection (σ) 2. Projection (Π) Note that RA Operators are Compositional! 3.
Lecture 33: The Relational Model 2 Professor Xiannong Meng Spring 2018 Lecture and activity contents are based on what Prof Chris Ré of Stanford used in his CS 145 in the fall 2016 term with permission
More informationChapter 4 Graphs and Matrices. PAD637 Week 3 Presentation Prepared by Weijia Ran & Alessandro Del Ponte
Chapter 4 Graphs and Matrices PAD637 Week 3 Presentation Prepared by Weijia Ran & Alessandro Del Ponte 1 Outline Graphs: Basic Graph Theory Concepts Directed Graphs Signed Graphs & Signed Directed Graphs
More informationCS521 \ Notes for the Final Exam
CS521 \ Notes for final exam 1 Ariel Stolerman Asymptotic Notations: CS521 \ Notes for the Final Exam Notation Definition Limit Big-O ( ) Small-o ( ) Big- ( ) Small- ( ) Big- ( ) Notes: ( ) ( ) ( ) ( )
More informationL322 Syntax. Chapter 3: Structural Relations. Linguistics 322 D E F G H. Another representation is in the form of labelled brackets:
L322 Syntax Chapter 3: Structural Relations Linguistics 322 1 The Parts of a Tree A tree structure is one of an indefinite number of ways to represent a sentence or a part of it. Consider the following
More informationEinführung in die Programmierung Introduction to Programming
Chair of Software Engineering Einführung in die Programmierung Introduction to Programming Prof. Dr. Bertrand Meyer Exercise Session 9 Today Ø Feedback on the mock exam Ø Recursion Ø Recursion Recursion
More informationFoundations of Computer Science Spring Mathematical Preliminaries
Foundations of Computer Science Spring 2017 Equivalence Relation, Recursive Definition, and Mathematical Induction Mathematical Preliminaries Mohammad Ashiqur Rahman Department of Computer Science College
More informationIntroduction to Computers and Programming. Concept Question
Introduction to Computers and Programming Prof. I. K. Lundqvist Lecture 7 April 2 2004 Concept Question G1(V1,E1) A graph G(V, where E) is V1 a finite = {}, nonempty E1 = {} set of G2(V2,E2) vertices and
More informationLecture 17: Hash Tables, Maps, Finish Linked Lists
....... \ \ \ / / / / \ \ \ \ / \ / \ \ \ V /,----' / ^ \ \.--..--. / ^ \ `--- ----` / ^ \. ` > < / /_\ \. ` / /_\ \ / /_\ \ `--' \ /. \ `----. / \ \ '--' '--' / \ / \ \ / \ / / \ \ (_ ) \ (_ ) / / \ \
More informationComputer Programming II C++ (830)
DESCRIPTION This is an advanced course in computer programming/software engineering and applications. It reviews and builds on the concepts introduced in CP I. It introduces students to dynamic data structures,
More informationCCCCS meeting October 31, Transferring Courses and Students
CCCCS meeting October 31, 2014 Transferring Courses and Students Louis Steinberg lou@cs.rutgers.edu Based on slides & info from Jerry Richter These slides available a http://www.cs.rutgers.edu/~lou 1 Outline
More informationLecture 32. No computer use today. Reminders: Homework 11 is due today. Project 6 is due next Friday. Questions?
Lecture 32 No computer use today. Reminders: Homework 11 is due today. Project 6 is due next Friday. Questions? Friday, April 1 CS 215 Fundamentals of Programming II - Lecture 32 1 Outline Introduction
More informationWrite the function of following in Windows Operating System:
Assignment - I (Lessons 1-6) 1. Answer any two of the following questions. Differentiate between RAM and EPROM? Describe major components of a computer. Differentiate between Inkjet Printer and Laser Printer?
More informationMajor components of ER diagram Practices
Major components of ER diagram Practices 1 1976 proposed by Peter Chen ER diagram is widely used in database design Represent conceptual level of a database system Describe things and their relationships
More informationFormal Methods of Software Design, Eric Hehner, segment 24 page 1 out of 5
Formal Methods of Software Design, Eric Hehner, segment 24 page 1 out of 5 [talking head] This lecture we study theory design and implementation. Programmers have two roles to play here. In one role, they
More informationChapter 4. Relations & Graphs. 4.1 Relations. Exercises For each of the relations specified below:
Chapter 4 Relations & Graphs 4.1 Relations Definition: Let A and B be sets. A relation from A to B is a subset of A B. When we have a relation from A to A we often call it a relation on A. When we have
More informationDefinition of Graphs and Trees. Representation of Trees.
Definition of Graphs and Trees. Representation of Trees. Chapter 6 Definition of graphs (I) A directed graph or digraph is a pair G = (V,E) s.t.: V is a finite set called the set of vertices of G. E V
More informationLecture 15: The subspace topology, Closed sets
Lecture 15: The subspace topology, Closed sets 1 The Subspace Topology Definition 1.1. Let (X, T) be a topological space with topology T. subset of X, the collection If Y is a T Y = {Y U U T} is a topology
More informationCMSC 341 Lecture 14: Priority Queues, Heaps
CMSC 341 Lecture 14: Priority Queues, Heaps Prof. John Park Based on slides from previous iterations of this course Today s Topics Priority Queues Abstract Data Type Implementations of Priority Queues:
More informationLecture 14: More Inheritance & Genericity
Chair of Software Engineering Einführung in die Programmierung Introduction to Programming Prof. Dr. Bertrand Meyer October 2006 February 2007 MP1 Lecture 14: More Inheritance & Genericity 2 Genericity:
More informationCS301 - Data Structures Glossary By
CS301 - Data Structures Glossary By Abstract Data Type : A set of data values and associated operations that are precisely specified independent of any particular implementation. Also known as ADT Algorithm
More informationMath 6 Long Range Plans Bill Willis. Strand: NUMBER Develop number sense. Textbook: Math Makes Sense 6
Math 6 Long Range Plans 2012-2013 Bill Willis Rationale: Based upon the mathematics program of studies, our learning environment will value and respect the diversity of students experiences and ways of
More informationEinführung in die Programmierung Introduction to Programming
Chair of Software Engineering Einführung in die Programmierung Introduction to Programming Prof. Dr. Bertrand Meyer Exercise Session 10 News Mock exam in 2 weeks (December 6 th, 7 th ) You have to be present
More informationRelations and Graphs
s and are Pictures of (Binary) s E. Wenderholm Department of Computer Science SUNY Oswego c 2016 Elaine Wenderholm All rights Reserved Outline 1 A Function that returns a boolean Special Properties of
More informationWeek - 04 Lecture - 01 Merge Sort. (Refer Slide Time: 00:02)
Programming, Data Structures and Algorithms in Python Prof. Madhavan Mukund Department of Computer Science and Engineering Indian Institute of Technology, Madras Week - 04 Lecture - 01 Merge Sort (Refer
More informationCantor-Schröder-Bernstein Theorem, Part 1
Cantor-Schröder-ernstein Theorem, Part 1 Jean. Larson and Christopher C. Porter MHF 3202 December 4, 2015 Proving Equinumerousity Up to this point, the main method we have had for proving that two sets
More informationComputer Programming II Python
EXAM INFORMATION Items 32 Points 33 Prerequisites SECONDARY MATH I COMPUTER PROGRAMMING I Grade Level 10-12 Course Length ONE YEAR DESCRIPTION This is an advanced course in computer programming/software
More informationFigure 4.1: The evolution of a rooted tree.
106 CHAPTER 4. INDUCTION, RECURSION AND RECURRENCES 4.6 Rooted Trees 4.6.1 The idea of a rooted tree We talked about how a tree diagram helps us visualize merge sort or other divide and conquer algorithms.
More informationLecture 1: Examples, connectedness, paths and cycles
Lecture 1: Examples, connectedness, paths and cycles Anders Johansson 2011-10-22 lör Outline The course plan Examples and applications of graphs Relations The definition of graphs as relations Connectedness,
More informationComputability Summary
Computability Summary Recursive Languages The following are all equivalent: A language B is recursive iff B = L(M) for some total TM M. A language B is (Turing) computable iff some total TM M computes
More informationNotes slides from before lecture. CSE 21, Winter 2017, Section A00. Lecture 10 Notes. Class URL:
Notes slides from before lecture CSE 21, Winter 2017, Section A00 Lecture 10 Notes Class URL: http://vlsicad.ucsd.edu/courses/cse21-w17/ Notes slides from before lecture Notes February 13 (1) HW5 is due
More informationRange Minimum Queries Part Two
Range Minimum Queries Part Two Recap from Last Time The RMQ Problem The Range Minimum Query (RMQ) problem is the following: Given a fixed array A and two indices i j, what is the smallest element out of
More informationToday s Outline. CSE 326: Data Structures Asymptotic Analysis. Analyzing Algorithms. Analyzing Algorithms: Why Bother? Hannah Takes a Break
Today s Outline CSE 326: Data Structures How s the project going? Finish up stacks, queues, lists, and bears, oh my! Math review and runtime analysis Pretty pictures Asymptotic analysis Hannah Tang and
More informationLecture 8: Control Structures I
Chair of Software Engineering Einführung in die Programmierung Introduction to Programming Prof. Dr. Bertrand Meyer Lecture 8: Control Structures I Intro. to Programming, lecture 8: Control structures
More informationFINAL EXAM REVIEW CS 200 RECITATIOIN 14
FINAL EXAM REVIEW CS 200 RECITATIOIN 14 I don t *think* the final is cumulative. Sangmi will say for sure during her review sessions. Either way, keep in mind that this course s material is naturally cumulative
More informationCS 4349 Lecture October 18th, 2017
CS 4349 Lecture October 18th, 2017 Main topics for #lecture include #minimum_spanning_trees. Prelude Homework 6 due today. Homework 7 due Wednesday, October 25th. Homework 7 has one normal homework problem.
More informationInside Microsoft* SQL Server 2008: T-SQL Querying
Microsoft Inside Microsoft* SQL Server 2008: T-SQL Querying Itzik Ben-Gan Lubor Kollor Dejan Sarka Steve Kass Table of Contents Foreword Acknowledgments Introduction xiii xv xix 1 Logical Query Processing
More informationUnit 4 Relational Algebra (Using SQL DML Syntax): Data Manipulation Language For Relations Zvi M. Kedem 1
Unit 4 Relational Algebra (Using SQL DML Syntax): Data Manipulation Language For Relations 2016 Zvi M. Kedem 1 Relational Algebra in Context User Level (View Level) Community Level (Base Level) Physical
More informationGraph and Digraph Glossary
1 of 15 31.1.2004 14:45 Graph and Digraph Glossary A B C D E F G H I-J K L M N O P-Q R S T U V W-Z Acyclic Graph A graph is acyclic if it contains no cycles. Adjacency Matrix A 0-1 square matrix whose
More informationCS 441 Discrete Mathematics for CS Lecture 24. Relations IV. CS 441 Discrete mathematics for CS. Equivalence relation
CS 441 Discrete Mathematics for CS Lecture 24 Relations IV Milos Hauskrecht milos@cs.pitt.edu 5329 Sennott Square Equivalence relation Definition: A relation R on a set A is called an equivalence relation
More informationCOMP251: Algorithms and Data Structures. Jérôme Waldispühl School of Computer Science McGill University
COMP251: Algorithms and Data Structures Jérôme Waldispühl School of Computer Science McGill University About Me Jérôme Waldispühl Associate Professor of Computer Science I am conducting research in Bioinformatics
More informationDigraphs and Relations
Digraphs and Relations RAKESH PRUDHVI KASTHURI 07CS1035 Professor: Niloy Ganguly Department of Computer Science and Engineering IIT Kharagpur November 6, 2008 November 6, 2008 Section 1 1 Digraphs A graph
More informationECE250: Algorithms and Data Structures Midterm Review
ECE250: Algorithms and Data Structures Midterm Review Ladan Tahvildari, PEng, SMIEEE Associate Professor Software Technologies Applied Research (STAR) Group Dept. of Elect. & Comp. Eng. University of Waterloo
More informationCIS 771: Software Specifications. Lecture 4: More Alloy Basics
CIS 771: Software Specifications Lecture 4: More Alloy Basics Copyright 2001-2002, Matt Dwyer, John Hatcliff, and Rod Howell. The syllabus and all lectures for this course are copyrighted materials and
More informationRelational Database: The Relational Data Model; Operations on Database Relations
Relational Database: The Relational Data Model; Operations on Database Relations Greg Plaxton Theory in Programming Practice, Spring 2005 Department of Computer Science University of Texas at Austin Overview
More informationSolutions to Quiz 1. (a) (3 points) Vertices x and y are in the same connected component. Solution. P (x, y)
Massachusetts Institute of Technology 6.042J/18.062J, Fall 05: Mathematics for Computer Science October 17 Prof. Albert R. Meyer and Prof. Ronitt Rubinfeld revised October 18, 2005, 125 minutes Solutions
More informationTrees and Tree Traversal
Trees and Tree Traversal Material adapted courtesy of Prof. Dave Matuszek at UPENN Definition of a tree A tree is a node with a value and zero or more children Depending on the needs of the program, the
More information(Refer Slide Time: 05:25)
Data Structures and Algorithms Dr. Naveen Garg Department of Computer Science and Engineering IIT Delhi Lecture 30 Applications of DFS in Directed Graphs Today we are going to look at more applications
More informationEE 368. Weeks 5 (Notes)
EE 368 Weeks 5 (Notes) 1 Chapter 5: Trees Skip pages 273-281, Section 5.6 - If A is the root of a tree and B is the root of a subtree of that tree, then A is B s parent (or father or mother) and B is A
More informationCSE 20 DISCRETE MATH. Winter
CSE 20 DISCRETE MATH Winter 2017 http://cseweb.ucsd.edu/classes/wi17/cse20-ab/ Final exam The final exam is Saturday March 18 8am-11am. Lecture A will take the exam in GH 242 Lecture B will take the exam
More information4. Entity Relationship Model
4. Entity Relationship Model a) ER-Model: Used to construct conceptual data model, representing the structure and constraints of a database, which is not dependent on a software (like DBMS) or any data
More informationDiscrete mathematics , Fall Instructor: prof. János Pach
Discrete mathematics 2016-2017, Fall Instructor: prof. János Pach - covered material - Lecture 1. Counting problems To read: [Lov]: 1.2. Sets, 1.3. Number of subsets, 1.5. Sequences, 1.6. Permutations,
More informationLecture 16. The Relational Model
Lecture 16 The Relational Model Lecture 16 Today s Lecture 1. The Relational Model & Relational Algebra 2. Relational Algebra Pt. II [Optional: may skip] 2 Lecture 16 > Section 1 1. The Relational Model
More informationCS:5810 Formal Methods in Software Engineering
CS:5810 Formal Methods in Software Engineering Introduction to Alloy Part 2 Copyright 2001-17, Matt Dwyer, John Hatcliff, Rod Howell, Laurence Pilard, and Cesare Tinelli. Created by Cesare Tinelli and
More information