CS728-2008 Lecture 9 Storeing and Querying Large Web Graphs.
9 Graphs
description
Transcript of 9 Graphs
![Page 1: 9 Graphs](https://reader036.fdocuments.in/reader036/viewer/2022062410/5681636e550346895dd44bd4/html5/thumbnails/1.jpg)
9 Graphs
![Page 2: 9 Graphs](https://reader036.fdocuments.in/reader036/viewer/2022062410/5681636e550346895dd44bd4/html5/thumbnails/2.jpg)
• A graph G = (V, E) consists of V, a nonempty set of vertices (or nodes) and E, a set of edges. Each edge has either one or two vertices associated with it, called its endpoints. An edge is said to connect its endpoints.
• A graph with an infinite vertex set is called an infinite graph, and a graph with finite vertex is called finite graph. In this book, we usually consider only finite graphs.
![Page 3: 9 Graphs](https://reader036.fdocuments.in/reader036/viewer/2022062410/5681636e550346895dd44bd4/html5/thumbnails/3.jpg)
• A graph in which each edge connects two different vertices and where no two edges connect the same pair of vertices is called a simple graph.
San FranciscoDenver Chicago
Washington
Detroit
New York
Los Angeles
Model of Computer Networks
![Page 4: 9 Graphs](https://reader036.fdocuments.in/reader036/viewer/2022062410/5681636e550346895dd44bd4/html5/thumbnails/4.jpg)
Model of Computer Networks
• Graphs that may have multiple edges connecting the same vertices are called multigraphs.
• multiplicity of an edge
San FranciscoDenver Chicago
Washington
Detroit
New York
Los Angeles
![Page 5: 9 Graphs](https://reader036.fdocuments.in/reader036/viewer/2022062410/5681636e550346895dd44bd4/html5/thumbnails/5.jpg)
• Sometimes a communication link connects a data center to itself for diagnosis purpose. Such edges are called loops. Graphs that includes loops and possibly multiedges are called pseudographs.
San FranciscoDenver Chicago
Washington
DetroitNew York
Los Angeles
![Page 6: 9 Graphs](https://reader036.fdocuments.in/reader036/viewer/2022062410/5681636e550346895dd44bd4/html5/thumbnails/6.jpg)
• undirected graphs• undirected edges• simple directed graphs• directed multigraphs (multiple directed edges,
multiplicity)• mixed graphs
![Page 7: 9 Graphs](https://reader036.fdocuments.in/reader036/viewer/2022062410/5681636e550346895dd44bd4/html5/thumbnails/7.jpg)
Denver Chicago
Washington
DetroitNew York
Los Angeles
Simple directed graphs
![Page 8: 9 Graphs](https://reader036.fdocuments.in/reader036/viewer/2022062410/5681636e550346895dd44bd4/html5/thumbnails/8.jpg)
Denver Chicago
Washington
DetroitNew York
Los Angeles
Directed multigraphs
![Page 9: 9 Graphs](https://reader036.fdocuments.in/reader036/viewer/2022062410/5681636e550346895dd44bd4/html5/thumbnails/9.jpg)
• Niche Overlap Graphs in Ecology
Graph Models
Shrew
Opossum
WoodpeckerMouse
Owl
Squirrel
HawkRaccoon
Crow
![Page 10: 9 Graphs](https://reader036.fdocuments.in/reader036/viewer/2022062410/5681636e550346895dd44bd4/html5/thumbnails/10.jpg)
• Acquaintanceship Graphs
A
B
GF
E
H
CD
I M
M K
LJ
![Page 11: 9 Graphs](https://reader036.fdocuments.in/reader036/viewer/2022062410/5681636e550346895dd44bd4/html5/thumbnails/11.jpg)
• Influence graphs
BH
CD
I M
M K
![Page 12: 9 Graphs](https://reader036.fdocuments.in/reader036/viewer/2022062410/5681636e550346895dd44bd4/html5/thumbnails/12.jpg)
• The Hollywood graph
![Page 13: 9 Graphs](https://reader036.fdocuments.in/reader036/viewer/2022062410/5681636e550346895dd44bd4/html5/thumbnails/13.jpg)
• Round Robin Tournament
B
H
D
I
M
C
![Page 14: 9 Graphs](https://reader036.fdocuments.in/reader036/viewer/2022062410/5681636e550346895dd44bd4/html5/thumbnails/14.jpg)
• Call graphs• The Web Graph• Roadmaps
![Page 15: 9 Graphs](https://reader036.fdocuments.in/reader036/viewer/2022062410/5681636e550346895dd44bd4/html5/thumbnails/15.jpg)
• Precedence Graphs and Concurrent Processing
dceSdeS
abdSacS
bSaS
:1:
:1:
1:0:
6
5
4
3
2
1
S1
S4S3
S5S6
S2
![Page 16: 9 Graphs](https://reader036.fdocuments.in/reader036/viewer/2022062410/5681636e550346895dd44bd4/html5/thumbnails/16.jpg)
9.2 Graph Terminology and Special Types of Graphs
• Two vertices u and v in an undirected graph G are called adjacent (or neighbors) in G if u and v are endpoints of an edge of G. If e is associated with {u,v}, the edge e is called incident with the vertices u and v. The edge e is also said connect u and v. The vertices u and v are called endpoints of an edge associated with {u,v}.
![Page 17: 9 Graphs](https://reader036.fdocuments.in/reader036/viewer/2022062410/5681636e550346895dd44bd4/html5/thumbnails/17.jpg)
• The degree of a vertex in an undirected graph is the number of edges incident with it, except that a loop at a vertex contributes twice to the degree of a vertex. The degree of the vertex v is denoted by deg(v).
• Example: What are the degrees of the vertices in the graphs G and H displayed below.
G H
a
ab bc
c
d
d
e
efg
![Page 18: 9 Graphs](https://reader036.fdocuments.in/reader036/viewer/2022062410/5681636e550346895dd44bd4/html5/thumbnails/18.jpg)
• Theorem: (The Handshaking Theorem) Let G = (u,v) be an undirected graph with e edges. Then
• Example: How many edges are there in a graph with 10 vertices each of degree six?
• 2e=610. Thus e=30
.)deg(2
Vv
ve
![Page 19: 9 Graphs](https://reader036.fdocuments.in/reader036/viewer/2022062410/5681636e550346895dd44bd4/html5/thumbnails/19.jpg)
• Theorem: An undirected graph has an even number of vertices of odd degree.
• Proof. Let V1 and V2 be the set of vertices of odd degree and the set of even degree.
Thus, |V1| is even.
.)deg()deg()deg(221
VvVvVv
vvve
![Page 20: 9 Graphs](https://reader036.fdocuments.in/reader036/viewer/2022062410/5681636e550346895dd44bd4/html5/thumbnails/20.jpg)
• When (u,v) is an edge of the graph G with directed edges, u is said to be adjacent to v and v is said to be adjacent from u. The vertex u is called the initial vertex of (u,v), and v is called the terminal or end vertex of (u,v). The initial vertex and the terminal vertex of a loop are the same.
![Page 21: 9 Graphs](https://reader036.fdocuments.in/reader036/viewer/2022062410/5681636e550346895dd44bd4/html5/thumbnails/21.jpg)
• In a graph with directed edges the in-degree of a vertex v, denoted by deg-(v), is the number of edges with v as their terminal vertex. The out-degree of a vertex v, denoted by deg+(v), is the number of edges with v as their initial vertex.
• Example: Find the in-degree and out-degree of each vertex of the following graph.
a b
c d
e
f
![Page 22: 9 Graphs](https://reader036.fdocuments.in/reader036/viewer/2022062410/5681636e550346895dd44bd4/html5/thumbnails/22.jpg)
• Theorem: Let G = (V,E) be a graph with directed edges. Then
.)(deg)(deg||
VvVv
vvE