© All Rights Reserved

4 views

© All Rights Reserved

- 3. Ijmcar - Application of Graph Theory in Representing
- Floyd–Warshall algorithm
- masterpeters.pdf
- CCN Lab Manual TE VTU
- Maths Module F4 2011b
- Installed Files
- MYP Command Terms
- Algorithm for searching bridges
- Tim Jones 3 Cap Spanish
- Activity Diagrams
- Carri To
- Module 2
- Global Settings
- Graph Database Indexing Using Structured Graph
- [JOEL SPENCER] Ten Lectures on the Probabilistic M(BookZZ.org)
- Discrete Syllabus
- Sequence of Transformations on Functions - MathBitsNotebook(A2 - CCSS Math)
- Physics.pdf
- networks_of_companies_from_stock_price_correlations.ppt
- ISTQB TM Table of Contents

You are on page 1of 29

Aaron Bloomfield

CS 202

Rosen, section 7.4

1

Relational closures

Three types we will study

Reflexive

Easy

Symmetric

Easy

Transitive

Hard

2

Reflexive closure

Consider a relation R:

From our MapQuest example in the last slide set

Note that it is not reflexive

make the relation reflexive

By adding those edges,

we have made a nonreflexive relation R into

a reflexive relation

This new relation is called the reflexive closure of R

Reflexive closure

In order to find the reflexive closure of a

relation R, we add a loop at each node

that does not have one

The reflexive closure of R is R U

Where = { (a,a) | a R }

Called the diagonal relation

4

Let R be a relation on the set { 0, 1, 2, 3 } containing the

ordered pairs (0,1), (1,1), (1,2), (2,0), (2,2), and (3,0)

What is the reflexive closure of R?

We add all pairs of edges (a,a) that do not already exist

0

We add edges:

(0,0), (3,3)

3

2

5

Symmetric closure

Consider a relation R:

From our MapQuest example in the last slide set

Note that it is not symmetric

make the relation symmetric

By adding those edges,

we have made a nonsymmetric relation R into

a symmetric relation

This new relation is called the symmetric closure of R

Symmetric closure

In order to find the symmetric closure of a

relation R, we add an edge from a to b,

where there is already an edge from b to a

The symmetric closure of R is R U R-1

If R = { (a,b) | }

Then R-1 = { (b,a) | }

Let R be a relation on the set { 0, 1, 2, 3 } containing the

ordered pairs (0,1), (1,1), (1,2), (2,0), (2,2), and (3,0)

What is the symmetric closure of R?

We add all pairs of edges (a,b) where (b,a) exists

We make all single edges into anti-parallel pairs

0

We add edges:

(0,2), (0,3)

(1,0), (2,1)

3

2

8

A path is a sequences of connected edges from vertex a

to vertex b

No path exists from

the noted start location

A path that starts and

ends at the same

vertex is called a

circuit or cycle

Start (a)

End (b)

Start (a)

End (b)

Start (a)

More on paths

The length of a path is the number of

edges in the path, not the number of

nodes

10

Shortest paths

What is really needed in most applications

is finding the shortest path between two

vertices

11

Fan-supplied demotivators!

12

Transitive closure

contain edges between all nodes

reachable by a path of any length

13

Transitive closure

Informal definition: If there is a path from a to b, then

there should be an edge from a to b in the transitive

closure

First take of a definition:

In order to find the transitive closure of a relation R, we add an

edge from a to c, when there are edges from a to b and b to c

(1,2) & (2,3) (1,3)

(2,3) & (3,4) (2,4)

R = { (1,2), (2,3), (3,4) } 4

1

1

2

3

15

Transitive closure

Informal definition: If there is a path from a to b, then there

should be an edge from a to b in the transitive closure

Second take of a definition:

In order to find the transitive closure of a relation R, we add an

edge from a to c, when there are edges from a to b and b to c

Repeat this step until no new edges are added to the relation

transitive closure

red means added on

the first repeat

teal means added on

the second repeat

4

1

2

3

16

6 degrees of separation

The idea that everybody in the world is

connected by six degrees of separation

Where 1 degree of separation means you know (or

have met) somebody else

world

(a,b) R if person a has met person b

a and g means:

(a,b), (b,c), (c,d), (d,e), (e,f), (f,g) are all in R

Or, (a,g) R6

17

Connectivity relation

RR = R2 contains edges between nodes that are reachable via 2

edges in R

R2R = R3 contains edges between nodes that are reachable via 3

edges in R

Rn = contains edges between nodes that are reachable via n edges

in R

number of edges (i.e. via any path) in R

Rephrased: R* contains all the edges between nodes a and b when is a

path of length at least 1 between a and b in R

The definition of a transitive closure is that there are edges between any

nodes (a,b) that contain a path between them

18

transitive closure?

Let R be a relation on set A, and let A be a set with n

elements

Rephrased: consider a graph G with n nodes and some number of

edges

b in R, then there is a path between a and b of length not

exceeding n

Proof preparation:

Let the length of that path be m

Let the path be edges (x0, x1), (x1, x2), , (xm-1, xm)

Thats nodes x0, x1, x2, , xm-1, xm

If a node exists twice in our path, then its not a shortest path

As we made no progress in our path between the two occurrences of

the repeated node

19

transitive closure?

Proof by contradiction:

Assume there are more than n nodes in the path

Thus, m > n

Let m = n+1

(pigeons) and they have to fit into the n nodes in the graph

(pigeonholes)

Thus, there must be at least one pigeonhole that has at least two

pigeons

Rephrased: there must be at least one node in the graph that has

two occurrences in the nodes of the path

Not possible, as the path would not be the shortest path

from a to b of at most length n

20

Let MR be the zero-one matrix of the relation R

on a set with n elements. Then the zero-one

matrix of the transitive closure R* is:

M R* M R M [R2] M [R3] M [Rn ]

Nodes reachable

with one application

of the relation

Nodes reachable

with two applications

of the relation

Nodes reachable

with n applications

of the relation

21

Find the zero-one matrix of the transitive

closure of the relation R given by:

1 0 1

M R 0 1 0

1 1 0

M [R2 ]

M R* M R M [R2] M [R3]

M [R2] M R

1 0 1

M R 0 1 0

1 1 0

1 0 1 1 1 1

0 1 0 0 1 0

1 1 0 1 1 1

22

M[R3] M [R2 ]

1 1 1

M R 0 1 0

1 1 1

1 0 1 1 1 1

0 1 0 0 1 0

1 1 0 1 1 1

M R*

1 0 1 1 1 1 1 1 1 1 1 1

0 1 0 0 1 0 0 1 0 0 1 0

1 1 0 1 1 1 1 1 1 1 1 1

23

What we did (or rather, could have done):

Compute the next matrix M [iR], where 1 i n

Do a Boolean join with the previously

computed matrix

Compute M[R2] M R M R

Join that with M R to yield M R M[R2]

[ 3]

[ 2]

M

M

Compute R

R MR

[ 2]

M

M

Join that with R

R from above

24

procedure transitive_closure (MR: zero-one nn matrix)

A := MR

B := A

for i := 2 to n

begin

A := A MR

B := B A

end { B is the zero-one matrix for R* }

25

More efficient algorithms exist, such as

Warshalls algorithm

We wont be studying it in this class

Thus, the material on pages 503-506 wont be

on the test

26

Motivational posters

27

Quick survey

a)

b)

c)

d)

slide set

Very well

With some review, Ill be good

Not really

Not at all

28

Quick survey

a)

b)

c)

d)

slide set was

Fast

About right

A little slow

Too slow

29

Quick survey

a)

b)

c)

d)

this slide set? Be honest!

Wow! That was SOOOOOO cool!

Somewhat interesting

Rather borting

Zzzzzzzzzzz

30

- 3. Ijmcar - Application of Graph Theory in RepresentingUploaded byTJPRC Publications
- Floyd–Warshall algorithmUploaded bybartee000
- masterpeters.pdfUploaded byEuchel Pauline Ramos
- CCN Lab Manual TE VTUUploaded byNarayana Swamy Ramaiah
- Maths Module F4 2011bUploaded bydavid70830chan
- Installed FilesUploaded byputputyeah
- MYP Command TermsUploaded byLennoxMeldrum
- Algorithm for searching bridgesUploaded byCrismaruc Maria-madalina
- Tim Jones 3 Cap SpanishUploaded byDiego Nuñez Ccallo
- Carri ToUploaded byEddie Aguilar Ruiz
- Module 2Uploaded byFaiz Kothari
- [JOEL SPENCER] Ten Lectures on the Probabilistic M(BookZZ.org)Uploaded byHector Silva
- Activity DiagramsUploaded byEno Ajah
- Global SettingsUploaded bykukul_kan
- Discrete SyllabusUploaded byHamza Chaudhry
- Sequence of Transformations on Functions - MathBitsNotebook(A2 - CCSS Math)Uploaded byBalkis
- Graph Database Indexing Using Structured GraphUploaded bybktod9201
- Physics.pdfUploaded byIftikhar Ahmed
- networks_of_companies_from_stock_price_correlations.pptUploaded byJimmy Bomfim de Jesus
- ISTQB TM Table of ContentsUploaded byaawaak
- Dap an Bai Thuc Hanh (1)Uploaded byVô Hạ Thiên Vương
- Math 112 Lecture 001 b HandoutsUploaded byAmmar A. Ali
- ResearchWork OrdonezUploaded byCarl Jacob Maningas
- Hier. Decomp. DC Power 1985Uploaded byPeter Knight
- Laplace_Table.pdfUploaded byRifki F. Nugraha
- De Cuong Thiet Ke Thoi TrangUploaded bychungpo
- EWG-Crash-report-Tue-Jan-19-14.29.48-CET-2016.txtUploaded byAnonymous FY9PVg1
- Technology Word SearchUploaded bylborozco2
- FALLSEM2013 14 CP0705 SYB MAT 516 Computational TechniquesUploaded bySomaraju Dasam
- A Hybrid Optimization Algorithm Based OnUploaded byAdam Hansen

- RecurrenceUploaded byrakeshkad12
- Ammount AllocationUploaded byMrconfusionSap
- Zmm r000 Material Details SelUploaded byMrconfusionSap
- Zmm r000 Material DetailsUploaded byMrconfusionSap
- Zoops 7am Local Data TypesUploaded byMrconfusionSap
- hs.txtUploaded byMrconfusionSap
- hs1.txtUploaded byMrconfusionSap
- hs2Uploaded byMrconfusionSap
- hs1Uploaded byMrconfusionSap
- main program of entire report.txtUploaded byMrconfusionSap
- Kirans (My Prog With Error)Uploaded byMrconfusionSap
- REPORT_DAY_20.06.2011Uploaded byMrconfusionSap
- Notes DdUploaded byMrconfusionSap
- Zoutbound PostingUploaded byMrconfusionSap
- FUNCTION Zidoc Input ZinvUploaded byMrconfusionSap
- zevents_test3.txtUploaded byMrconfusionSap
- Events222Uploaded byMrconfusionSap
- zevents_test.txtUploaded byMrconfusionSap
- IF_EX_ME_BAPI_PO_CREATE_02~INBOUNDUploaded byMrconfusionSap
- 21 aug 11 text fileUploaded byMrconfusionSap
- VL02n.txtUploaded byMrconfusionSap
- NotesUploaded byMrconfusionSap
- Skeleten of NotepadUploaded byMrconfusionSap
- Disabled Yc Act 09092016Uploaded byMrconfusionSap
- 63_profit_lossUploaded byAnu Thomas
- 05-02-2012 NOTEPADUploaded byMrconfusionSap

- c progUploaded bySharafatAli
- BoltUploaded byHari Baskar
- Chapter 1 - Understanding PhysicsUploaded byZulhisyam Nordin
- InfoSphere DataStage - Operations Console Guide and Reference 9.1Uploaded byreeth04
- C-Bus Training Hardware InstallationUploaded byHujiLoko
- En - General Description WendeWolfUploaded byUmpahPah75
- Evap Handbook1Uploaded byarun89000
- SWLS(SatWithLifeScale)Uploaded byJiřina Liliana Doubková
- TRNG-6 Potential TransformerUploaded bybaoHVLAB
- 21010-BAE-70000-In-SP-0030 Tech Spec for Inst. and Controls for Packaged EquipmentUploaded byJignesh Banava
- Vol. 1_PG.1Uploaded byyadavsticky5108
- How to Tune for SmogUploaded byLunk2k
- SEIMENS_MS_420_ENGINE_CONTROL_SYSTEM.pdfUploaded bybrst4
- Pankow Report 1- Purdue University - Dual Plate Composite Shear WallUploaded byvodugu123
- 3G KPIUploaded byKrishanth Ppt
- Practice Exam for Exam3 CHE116Uploaded byaumi77
- Ns3 Part1 IntroductionUploaded bydiaagustya
- Lecture 10- Work heat energyUploaded bySYZC
- 2006 Reverchon (Supercritical Fluid Extraction and Fractionation Ofnatural Matter)Uploaded byDani Carrasco
- Comparison of Programming LanguagesUploaded byHelton Santos
- Appendix 1Uploaded byStefano De Simone
- A106 A672 A53 API5L ComparisonUploaded bykyashkumar
- Automatic BalancingUploaded bySamehibrahem
- rohm catalog2010Uploaded byTimofte Lazar
- _notesnbeats.pdfUploaded byLouisa
- Acemoglu_General Equilibrium and Develop. econ.Uploaded byWilliam Nguyen
- EEESyll.pdfUploaded byRahul Thandu
- The 10 Best Momentum Stock Chart PatternsUploaded bybelewjo
- OSM C-4 Process AnalysisUploaded bymathurrohit1987
- Pre Ph.D. Mechanical Engg.Uploaded byJv Sudheendra