Relations and Graphs

Similar documents
10/11/2018. Partial Orderings. Partial Orderings. Partial Orderings. Partial Orderings. Partial Orderings. Partial Orderings

Digraphs and Relations

A set with only one member is called a SINGLETON. A set with no members is called the EMPTY SET or 2 N

Outline Purpose Disjoint Sets Maze Generation. Disjoint Sets. Seth Long. March 24, 2010

Binary Relations Part One

Functions and Relations

Foundations of Computer Science Spring Mathematical Preliminaries


CS 151. Binary Trees. Friday, October 5, 12

Lecture 22 Tuesday, April 10

Lecture 10: Strongly Connected Components, Biconnected Graphs

Logic and Discrete Mathematics. Section 2.5 Equivalence relations and partitions

Graphs & Digraphs Tuesday, November 06, 2007

Relations. We have seen several types of abstract, mathematical objects, including propositions, predicates, sets, and ordered pairs and tuples.

Graph and Digraph Glossary

Relational Database: The Relational Data Model; Operations on Database Relations

Definition of Graphs and Trees. Representation of Trees.

Graphs Definitions. Gunnar Gotshalks. GraphDefinitions 1

CMPSCI 250: Introduction to Computation. Lecture #22: Graphs, Paths, and Trees David Mix Barrington 12 March 2014

Lecture 1: Examples, connectedness, paths and cycles

Trees. Q: Why study trees? A: Many advance ADTs are implemented using tree-based data structures.

CS24 Week 8 Lecture 1

Binary Relations Part One

Computational Geometry

Data Structures - Binary Trees and Operations on Binary Trees

CS314: FORMAL LANGUAGES AND AUTOMATA THEORY L. NADA ALZABEN. Lecture 1: Introduction

Graph Theory. Probabilistic Graphical Models. L. Enrique Sucar, INAOE. Definitions. Types of Graphs. Trajectories and Circuits.

MAT 7003 : Mathematical Foundations. (for Software Engineering) J Paul Gibson, A207.

Data Structures and Algorithms (DSA) Course 9 Lists / Graphs / Trees. Iulian Năstac


Lattice Tutorial Version 1.0

Relations, Equivalence Relations, and Partial Orders

CONTENTS Equivalence Classes Partition Intersection of Equivalence Relations Example Example Isomorphis

Theory of Computation

Graph Theory. ICT Theory Excerpt from various sources by Robert Pergl

CHAPTER 3 FUZZY RELATION and COMPOSITION

DS UNIT 4. Matoshri College of Engineering and Research Center Nasik Department of Computer Engineering Discrete Structutre UNIT - IV

Chapter 10: Trees. A tree is a connected simple undirected graph with no simple circuits.

CS 216 Fall 2007 Midterm 1 Page 1 of 10 Name: ID:

March 20/2003 Jayakanth Srinivasan,

Introduction to Computers and Programming. Concept Question

Disjoint Sets and the Union/Find Problem

CS 173 Lecture 18: Relations on a Set

Lecture Notes on Real-world SMT

Conceptual modeling of entities and relationships using Alloy

UNIT III TREES. A tree is a non-linear data structure that is used to represents hierarchical relationships between individual data items.

Objective Questions for Online Practical Exams under CBCS Scheme Subject: Data Structure-I (CS-113)

Trees. 3. (Minimally Connected) G is connected and deleting any of its edges gives rise to a disconnected graph.

Graphs: basic concepts and algorithms

IX. Binary Trees (Chapter 10)

Binary Relations McGraw-Hill Education

Computer Science and Mathematics. Part I: Fundamental Mathematical Concepts Winfried Kurth

Today. Types of graphs. Complete Graphs. Trees. Hypercubes.

CS 361 Data Structures & Algs Lecture 11. Prof. Tom Hayes University of New Mexico

Reference Sheet for CO142.2 Discrete Mathematics II

Graphs. A graph is a data structure consisting of nodes (or vertices) and edges. An edge is a connection between two nodes

Antisymmetric Relations. Definition A relation R on A is said to be antisymmetric

Behavior models and verification Lecture 6

Data Structure. IBPS SO (IT- Officer) Exam 2017

Binary Decision Diagrams

Trees. Tree Structure Binary Tree Tree Traversals

We have the pointers reference the next node in an inorder traversal; called threads

Jana Kosecka. Red-Black Trees Graph Algorithms. Many slides here are based on E. Demaine, D. Luebke slides

ITI Introduction to Computing II

CS200: Graphs. Prichard Ch. 14 Rosen Ch. 10. CS200 - Graphs 1

IX. Binary Trees (Chapter 10) Linear search can be used for lists stored in an array as well as for linked lists. (It's the method used in the find

Basic Graph Definitions

Algorithms and Data Structures

CSCI-401 Examlet #5. Name: Class: Date: True/False Indicate whether the sentence or statement is true or false.

Slides for Faculty Oxford University Press All rights reserved.

Graph definitions. There are two kinds of graphs: directed graphs (sometimes called digraphs) and undirected graphs. An undirected graph

ALGORITHMS EXAMINATION Department of Computer Science New York University December 17, 2007

ITI Introduction to Computing II

CMSC th Lecture: Graph Theory: Trees.

CS 310 Advanced Data Structures and Algorithms

Datalog. Rules Programs Negation

TREES Lecture 10 CS2110 Spring2014

Trees, Part 1: Unbalanced Trees

Binary Trees, Binary Search Trees

Crossing bridges. Crossing bridges Great Ideas in Theoretical Computer Science. Lecture 12: Graphs I: The Basics. Königsberg (Prussia)

Computer Vision Group Prof. Daniel Cremers. 4. Probabilistic Graphical Models Directed Models

Data Structure - Binary Tree 1 -

An undirected graph is a tree if and only of there is a unique simple path between any 2 of its vertices.

Hamilton paths & circuits. Gray codes. Hamilton Circuits. Planar Graphs. Hamilton circuits. 10 Nov 2015

Advanced Set Representation Methods

CSI 604 Elementary Graph Algorithms

Assignment 4 Solutions of graph problems

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

CHAPTER 3 FUZZY RELATION and COMPOSITION

Verifying pattern matching with guards in Scala

Foundations of Discrete Mathematics

1 Problem Description

Trees. See Chapter 18 of Weiss

Introduction to Sets and Logic (MATH 1190)

Chapter 20: Binary Trees

Chapter 4. Relations & Graphs. 4.1 Relations. Exercises For each of the relations specified below:

18.3 Deleting a key from a B-tree

Algorithms and Data Structures

Trees (Part 1, Theoretical) CSE 2320 Algorithms and Data Structures University of Texas at Arlington

Tree Structures. A hierarchical data structure whose point of entry is the root node

Transcription:

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 s 2 A Picture of a Binary Types of Properties of 3 are Restricted Binary

Predicates Functions that return a boolean A Function that returns a boolean Special Properties of s A predicate (also called a property) is function f : X 1... X n boolean, n 1 that returns a boolean value.

Predicates Functions that return a boolean A Function that returns a boolean Special Properties of s A predicate (also called a property) is function f : X 1... X n boolean, n 1 that returns a boolean value. The sets can be different sets, or all the same sets.

Predicates Functions that return a boolean A Function that returns a boolean Special Properties of s A predicate (also called a property) is function f : X 1... X n boolean, n 1 that returns a boolean value. The sets can be different sets, or all the same sets. A predicate whose domain is a set of k-tuples (of the same set) is called a k-ary relation k-ary predicate k-ary relation on A.

Predicates Functions that return a boolean A Function that returns a boolean Special Properties of s A predicate (also called a property) is function f : X 1... X n boolean, n 1 that returns a boolean value. The sets can be different sets, or all the same sets. A predicate whose domain is a set of k-tuples (of the same set) is called a k-ary relation k-ary predicate k-ary relation on A. A predicate defines a partition of the domain.

Predicates Functions that return a boolean A Function that returns a boolean Special Properties of s A predicate (also called a property) is function f : X 1... X n boolean, n 1 that returns a boolean value. The sets can be different sets, or all the same sets. A predicate whose domain is a set of k-tuples (of the same set) is called a k-ary relation k-ary predicate k-ary relation on A. A predicate defines a partition of the domain. Some k-tuples are mapped to true; the rest are mapped to false.

s Definitions A Function that returns a boolean Special Properties of s R A = (A 1... A k ) = {(a 1,..., a k ) R(a 1,..., a k ) = true}

s Definitions A Function that returns a boolean Special Properties of s R A = (A 1... A k ) = {(a 1,..., a k ) R(a 1,..., a k ) = true} A k-ary relation R is a subset of A in which R evaluates to true. If all the A i are the same sets, we say that R is a relation on A. A 2 ary relation is called a binary relation. A binary relation is often written as an infix operator.

s s with Special Properties A Function that returns a boolean Special Properties of s R is some binary relation on A. We say: R is reflexive iff a A, ara.

s s with Special Properties A Function that returns a boolean Special Properties of s R is some binary relation on A. We say: R is reflexive iff a A, ara. R is symmetric iff a, b A, arb bra.

s s with Special Properties A Function that returns a boolean Special Properties of s R is some binary relation on A. We say: R is reflexive iff a A, ara. R is symmetric iff a, b A, arb bra. R is transitive iff a, b, c A, arb brc arc

s s with Special Properties A Function that returns a boolean Special Properties of s R is some binary relation on A. We say: R is reflexive iff a A, ara. R is symmetric iff a, b A, arb bra. R is transitive iff a, b, c A, arb brc arc R is an equivalence relation if it is: reflexive, symmetric, and transitive. An equivalence relation forms a partition of the domain.

Directed A Picture of a Binary A Picture of a Binary Types of Properties of Take some binary relation R on A. R A A = {(a 1, a 2 ) arb is true } A Graph G = (V, E) is:

Directed A Picture of a Binary A Picture of a Binary Types of Properties of Take some binary relation R on A. R A A = {(a 1, a 2 ) arb is true } A Graph G = (V, E) is: V is the set of nodes (Vertices) of the graph.

Directed A Picture of a Binary A Picture of a Binary Types of Properties of Take some binary relation R on A. R A A = {(a 1, a 2 ) arb is true } A Graph G = (V, E) is: V is the set of nodes (Vertices) of the graph. Each node is drawn, perhaps with a dot, with it s name.

Directed A Picture of a Binary A Picture of a Binary Types of Properties of Take some binary relation R on A. R A A = {(a 1, a 2 ) arb is true } A Graph G = (V, E) is: V is the set of nodes (Vertices) of the graph. Each node is drawn, perhaps with a dot, with it s name. E is the set of ordered pairs (Edges) for which the relation R is true.

Directed A Picture of a Binary A Picture of a Binary Types of Properties of Take some binary relation R on A. R A A = {(a 1, a 2 ) arb is true } A Graph G = (V, E) is: V is the set of nodes (Vertices) of the graph. Each node is drawn, perhaps with a dot, with it s name. E is the set of ordered pairs (Edges) for which the relation R is true. The elements in the ordered pair are in V. Given the ordered par (a, b), it is drawn as a b. A graph is directed if it s edges are drawn with arrows.

Types of Properties in Pictures A Picture of a Binary Types of Properties of All the edges in an undirected graph are drawn with straight lines, not arrows. An undirected graph is a picture of a symmetric relation. A directed graph has all directed edges. All edges are drawn with arrows. A labeled graph has data associated with each edge. This is typically thought of as a cost.

Definitions of Properties A Picture of a Binary Types of Properties of The degree of a node is the number of edges that are incident on the node.

Definitions of Properties A Picture of a Binary Types of Properties of The degree of a node is the number of edges that are incident on the node. The in-degree is the number of incoming edges to the node; the out-degree is the number of outgoing edges from the node. A path is a sequence of nodes connected by edges. A simple path does not visit any node more than once. A cycle is a path that starts and ends at the same node. A graph that contains no cyclics is called acyclic

All are All are not are Restricted Binary A Tree contains no cycles. There is a distinguished node, called the root of the tree, which has no incoming edges. A tree is acyclic. There is a unique path from the root to every other node in the tree. A leaf is a node which has no outgoing edges. The frontier of a tree a sequence of the leaf nodes of the tree, written in left-to-right order. are drawn with the root as the topmost node. Edges are directed, and drawn downward. Edges appear to be symmetric but arrow are directed downward by default.

Binary A maximum of 2 outgoing edges are Restricted Binary All the nodes in Binary Tree have at most two outgoing edges. A Binary Tree is usually defined recursively, as follows.

Binary A maximum of 2 outgoing edges are Restricted Binary All the nodes in Binary Tree have at most two outgoing edges. A Binary Tree is usually defined recursively, as follows. Basis: A Binary Tree is the Empty Tree.

Binary A maximum of 2 outgoing edges are Restricted Binary All the nodes in Binary Tree have at most two outgoing edges. A Binary Tree is usually defined recursively, as follows. Basis: A Binary Tree is the Empty Tree. Recursion: A Binary Tree consists of a set of nodes V. A distinguished node R V, called the root of the tree, has no incoming nodes. The rest of the nodes, V-R, are partitioned into two subsets, called the Left Subtree of R, and the Right Subtree of R, each of which is a Binary Tree.