1 / 9

2014 년 봄학기 강원대학교 컴퓨터과학전공 문양세

이산수학 (Discrete Mathematics) 관계의 표현 (Representing Relations). 2014 년 봄학기 강원대학교 컴퓨터과학전공 문양세. Representing Relations. Representing Relations. Some ways to represent n -ary relations: With an explicit list or table of its tuples.

kura
Télécharger la présentation

2014 년 봄학기 강원대학교 컴퓨터과학전공 문양세

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 이산수학(Discrete Mathematics) 관계의 표현 (Representing Relations) 2014년 봄학기 강원대학교 컴퓨터과학전공 문양세

  2. Representing Relations Representing Relations • Some ways to represent n-ary relations: • With an explicit list or table of its tuples. • With a function,or with an algorithm for computing this function. • Some special ways to represent binary relations: • With a zero-one matrix. • With a directed graph.

  3. Using Zero-One Matrices Representing Relations To represent a relation R by a matrix MR = [mij], let mij = 1 if (ai,bj)R, else 0. E.g., Joe likes Susan and Mary, Fred likes Mary, and Mark likes Sally. The 0-1 matrix representationof that “Likes”relation:

  4. Zero-One Reflexive, Symmetric (1/2) Representing Relations • Terms: Reflexive, irreflexive, symmetric, and antisymmetric. • These relation characteristics are very easy to recognize by inspection of the zero-one matrix. any-thing any-thing any-thing any-thing Irreflexive:all 0’s on diagonal Reflexive:all 1’s on diagonal

  5. Zero-One Reflexive, Symmetric (2/2) Representing Relations anything anything Symmetric:all identicalacross diagonal Antisymmetric:all 1’s are acrossfrom 0’s

  6. Using Directed Graphs (1/2) Representing Relations A directed graph or digraphG=(VG,EG) is a set VGof vertices (nodes) with a set EGVG×VG of edges (arcs,links).(관계는 노드(꼭지점)의 집합 V와 에지(링크)의 집합 E로 표현되는 방향성 그래프로 나타낼 수 있다.) Visually represented using dots for nodes, and arrows for edges. Notice that a relation R:A↔B can be represented as a graph GR=(VG=AB, EG=R).(일반적으로, 노드는 점으로, 에지는 화살표로 표현한다.)

  7. Using Directed Graphs (2/2) Representing Relations Edge set EG(blue arrows) GR MR Joe Susan Fred Mary Mark Sally Node set VG(black dots)

  8. Digraph Reflexive, Symmetric Representing Relations It is extremely easy to recognize the reflexive/irreflexive/ symmetric/antisymmetric properties by graph inspection.            Reflexive:Every nodehas a self-loop Irreflexive:No nodelinks to itself Symmetric:Every link isbidirectional Antisymmetric:No link isbidirectional Asymmetric, non-antisymmetric Non-reflexive, non-irreflexive

  9. Homework #7 Representing Relations

More Related