Graphs
description
Transcript of Graphs
![Page 1: Graphs](https://reader035.fdocuments.in/reader035/viewer/2022062806/56814f9a550346895dbd5725/html5/thumbnails/1.jpg)
Graphs
Rosen 8.1, 8.2
![Page 2: Graphs](https://reader035.fdocuments.in/reader035/viewer/2022062806/56814f9a550346895dbd5725/html5/thumbnails/2.jpg)
There Are Many Uses for Graphs!
• Networks• Data organizations• Scene graphs• Geometric simplification• Program structure and processes• Lots of others….• Also applications (e.g., species structure—
phylogeny tree)
![Page 3: Graphs](https://reader035.fdocuments.in/reader035/viewer/2022062806/56814f9a550346895dbd5725/html5/thumbnails/3.jpg)
Definitions• A simple graph G = (V,E) consists of V, a
nonempty set of vertices, and E, a set of unordered pairs of distinct elements of V called edges.
• A multigraph G = (V,E) consists of a set V of vertices, a set E of edges, and a function f from E to {{u,v} | u,v V, u ≠ v}. The edges e1 and e2 are called multiple or parallel edges if f(e1) = f(e2).
![Page 4: Graphs](https://reader035.fdocuments.in/reader035/viewer/2022062806/56814f9a550346895dbd5725/html5/thumbnails/4.jpg)
Properties
Simple graph– Undirected– Single edges– No loops
Multigraph– Undirected– Multiple edges– No loops
![Page 5: Graphs](https://reader035.fdocuments.in/reader035/viewer/2022062806/56814f9a550346895dbd5725/html5/thumbnails/5.jpg)
Examples
San Francisco
Los Angeles
Denver
Chicago
Detroit
Atlanta
New York
Simple Graph(computer backbone)
San Francisco
Los Angeles
Denver
Chicago
Detroit
Atlanta
New York
MultiGraph(computer backbonewith redundant connections)
![Page 6: Graphs](https://reader035.fdocuments.in/reader035/viewer/2022062806/56814f9a550346895dbd5725/html5/thumbnails/6.jpg)
Directed Graph• A directed graph consists of a set of
vertices V and a set of edges E that are ordered pairs of V– Loops are allowed– Multiple edges are allowed
14
7
Digraph for equivalence relation on {1,4,7}
![Page 7: Graphs](https://reader035.fdocuments.in/reader035/viewer/2022062806/56814f9a550346895dbd5725/html5/thumbnails/7.jpg)
Adjacency and Degree
• Two vertices u and v in an undirected graph are called adjacent (or neighbors) in G if e = {u,v} is an edge of G. The edge e is said to connect u and v. The vertices u and v are called the endpoints of e.
• The degree of a vertex in an undirected graph is the number of edges that are incident with (or connect) it, except that a loop at a vertex contributes twice to the degree. The degree of the vertex v is denoted by deg(v).
![Page 8: Graphs](https://reader035.fdocuments.in/reader035/viewer/2022062806/56814f9a550346895dbd5725/html5/thumbnails/8.jpg)
Handshaking Theorem
Let G = (V,E) be an undirected graph with e edges. Then
(Note that this applies even if multiple edges and loops are present.)
∑∈
=Vv
).vdeg(e2
![Page 9: Graphs](https://reader035.fdocuments.in/reader035/viewer/2022062806/56814f9a550346895dbd5725/html5/thumbnails/9.jpg)
How many edges are there in a graph with ten vertices each of degree 6?
Since the sum of the degrees of the vertices is 6·10 = 60, it follows that 2e =60.
Therefore, e = 30.
![Page 10: Graphs](https://reader035.fdocuments.in/reader035/viewer/2022062806/56814f9a550346895dbd5725/html5/thumbnails/10.jpg)
Prove that an undirected graph has an even number of vertices of odd degree.
Let V1 and V2 be the set of vertices of even degree and the set of vertices of odd degree, respectively, in an undirected graph G = (V,E).
Then∑ ∑ ∑∈ ∈ ∈
+==Vv Vv Vv1 2
).vdeg()vdeg()vdeg(e2
Since deg(v) is even for v V1, this term is even.
![Page 11: Graphs](https://reader035.fdocuments.in/reader035/viewer/2022062806/56814f9a550346895dbd5725/html5/thumbnails/11.jpg)
Prove that an undirected graph has an even number of vertices of odd degree.
Furthermore, the sum of these two terms is even, since the sum is 2e. Hence, the second term in the sum is also even. (Why?) Since all the terms in the sum are odd, there must be an even number of such terms. (Why?) Thus there are an even number of vertices of odd degree.
What can we say about the vertices of even degree?
∑ ∑ ∑∈ ∈ ∈
+==Vv Vv Vv1 2
).vdeg()vdeg()vdeg(e2
![Page 12: Graphs](https://reader035.fdocuments.in/reader035/viewer/2022062806/56814f9a550346895dbd5725/html5/thumbnails/12.jpg)
Cycles
The cycle Cn, n≥3, consists of n vertices
v1, v2,…, vn, and edges {v1, v2}, {v2, v3},…,
{vn-1, vn}, {vn, v1}.
C3 C4 C5
![Page 13: Graphs](https://reader035.fdocuments.in/reader035/viewer/2022062806/56814f9a550346895dbd5725/html5/thumbnails/13.jpg)
TreeA circuit is a path of edges that begins and ends
at the same vertex.
A path or circuit is simple if it does not contain the same edge more than once.
• A tree is a connected undirected graph with no simple circuits.
• A forest is a set of trees that are not
connected.
![Page 14: Graphs](https://reader035.fdocuments.in/reader035/viewer/2022062806/56814f9a550346895dbd5725/html5/thumbnails/14.jpg)
Q
Q QQ Q
Q
Q QQ Q
Q
Q QQ Q
Q QQ Q
Linked Global Quadtrees
Example: Quadtree
![Page 15: Graphs](https://reader035.fdocuments.in/reader035/viewer/2022062806/56814f9a550346895dbd5725/html5/thumbnails/15.jpg)
Example: Quadtree
}22 levels
Regular Triangularization (128 x 128 grid points)
Q
Q QQ Q
Q
Q QQ Q
Q
Q QQ Q
Q QQ Q
Linked Global Quadtrees
![Page 16: Graphs](https://reader035.fdocuments.in/reader035/viewer/2022062806/56814f9a550346895dbd5725/html5/thumbnails/16.jpg)
Quadtree: Terrain
Global Terrain (elevation & imagery)
•Multiresolution•Scalable (multiple terabyte databases)
•Efficient (100 to1or more reduction)
![Page 17: Graphs](https://reader035.fdocuments.in/reader035/viewer/2022062806/56814f9a550346895dbd5725/html5/thumbnails/17.jpg)
View-Dependent Simplification
![Page 18: Graphs](https://reader035.fdocuments.in/reader035/viewer/2022062806/56814f9a550346895dbd5725/html5/thumbnails/18.jpg)
Building a Vertex Hierarchy
QuadricSimplification
OriginalMesh
BaseMesh
Vertex Tree
![Page 19: Graphs](https://reader035.fdocuments.in/reader035/viewer/2022062806/56814f9a550346895dbd5725/html5/thumbnails/19.jpg)
Meshing From a Vertex Hierarchy
OriginalMesh
BaseMesh
Geometry & Appearance Metric