Download presentation
Presentation is loading. Please wait.
1
Introduction to Graph Theory
CPSC 221 2011/03/09
2
Learning Goals Today, we will: - Formally define graphs.
- Convert between adjacency matrices/lists and their corresponding graphs. - Examine graph isomorphism.
3
What is Graph Theory? It is a branch of mathematics dating back to the 1700s. Euler's paper on the Seven Bridges of Königsberg is considered to be the first paper on graph theory. Graph: adjective, relating to graphs. Theory: noun, theory. Thus, graph theory: theory relating to graphs.
4
What is Graph Theory? A graph is an abstract structure that expresses connections.
5
What is Graph Theory? A graph is an abstract structure that expresses connections. For example: a is connected to b, d, and e; b to c and d; d to e.
6
What is Graph Theory? A graph is an abstract structure that expresses connections. For example: a is connected to b, d, and e; b to c and d; d to e. Give your interpretation of this set of statements by drawing a picture.
7
Why Graph Theory? Some of its many applications include...
- Search algorithms.
8
Why Graph Theory? Some of its many applications include...
- Search algorithms. - Register allocation.
9
Why Graph Theory? Some of its many applications include...
- Search algorithms. - Register allocation. - Flow networks.
10
Why Graph Theory? Some of its many applications include...
- Search algorithms. - Register allocation. - Flow networks. - Social networks, naturally.
11
Definitions A graph is a tuple G = (V, E) where V is a set of vertices, and E is a set of edges. A vertex is a distinct value, such as a number or string. Bob, 5, ... An edge is a 2-element set of vertices from V. {Alice, Bob}, {4, 7}, ...
12
Definitions A loop is an edge connecting one vertex to itself, i.e. (x, x). A simple graph has no loops, and no more than 1 edge between any 2 vertices. A directed edge is an ordered pair of vertices, instead of a set. That is, (Alice, Bob) is different from (Bob, Alice). An undirected graph is one whose edges are not directed. We mostly work with simple, undirected graphs in CPSC 221.
13
Definitions Example: a is connected to b, d, and e; b to c and d; d to e. V = {a, b, c, d, e} E = {{a, b}, {a, d}, {a, e}, {b, c}, {b, d}, {d, e}} For each edge {x, y}, vertices x and y are said to be adjacent.
14
Examples of Graphs Trees: Complete graphs:
15
Adjacency List An adjacency list is a data structure for representing a graph. It maintains a list of vertices; associated with each vertex is a list of all vertices adjacent to it. a → {b, d, e} b → {a, c, d} c → {b} d → {a, b, e} e → {a, d}
16
Adjacency Matrix An adjacency matrix is another way to represent a graph. For a graph G, let n = |V|, its number of vertices. We arbitrarily number the vertices 1 to n. The adjacency matrix of G is an n by n matrix where each entry aij is equal to 1 if vertices i and j are adjacent, and 0 otherwise. (a:1, b:2, c:3, d:4, e:5)
17
Isomorphism Consider these two graphs, G1 = (V1, E1) and G2 = (V2, E2). Are they similar in some way? V1 = {a, b, c, d, e} E1 = {{a, b}, {a, d}, {a, e}, {b, c}, {b, d}, {d, e}} V2 = {v, w, x, y, z} E2 = {{v, w}, {v, x}, {v, y}, {w, x}, {w, y}, {x, z}}
18
Isomorphism Consider these two graphs, G1 = (V1, E1) and G2 = (V2, E2). Are they similar in some way? V1 = {a, b, c, d, e} E1 = {{a, b}, {a, d}, {a, e}, {b, c}, {b, d}, {d, e}} V2 = {v, w, x, y, z} E2 = {{v, w}, {v, x}, {v, y}, {w, x}, {w, y}, {x, z}} Draw them.
19
Isomorphism If we apply to G1 the function (a, b, c, d, e) → (v, x, z, w, y), it would result in exactly G2!
20
Isomorphism If we apply to G1 the function (a, b, c, d, e) → (v, x, z, w, y), it would result in exactly G2! Recall that order does not matter in a set. V1' = {v, x, z, w, y} E1' = {{v, x}, {v, w}, {v, y}, {x, z}, {x, w}, {w, y}} Such a function is called an isomorphism between graphs. It means that the graphs have the same structure.
21
Isomorphism No polynomial-time algorithm for determining graph isomorphism in general has been found. However, the problem has been solved for special cases such as trees. What are some clues to isomorphism?
22
More Definitions The degree of a vertex v, deg(v), is the number of edges incident to (touching) it. On a drawing, simply count the number of segments radiating from a vertex. Note that a loop is counted twice. The degree sequence of a graph is a non- increasing sequence formed by the degrees of its vertices. A path in a graph is a sequence of vertices where each vertex has an edge to the next vertex. A cycle is a path whose first and vertices are the same.
23
More Isomorphism Consider these graphs, drawn for simplicity.
Are they isomorphic? Why or why not?
24
More Isomorphism Are these graphs isomorphic? Why or why not?
25
Closing Remarks We see that if two graphs are isomorphic, they both satisfy some fact. ~SomeFact(G, H) → ~Isomorphic(G, H)
26
Closing Remarks We see that if two graphs are isomorphic, they both satisfy some fact. ~SomeFact(G, H) → ~Isomorphic(G, H) ∴ Isomorphic(G, H) → SomeFact(G, H)
27
Closing Remarks We see that if two graphs are isomorphic, they both satisfy some fact. ~SomeFact(G, H) → ~Isomorphic(G, H) ∴ Isomorphic(G, H) → SomeFact(G, H) However, this does not tell us anything about the other direction...
28
Closing Remarks We see that if two graphs are isomorphic, they both satisfy some fact. ~SomeFact(G, H) → ~Isomorphic(G, H) ∴ Isomorphic(G, H) → SomeFact(G, H) However, this does not tell us anything about the other direction... SomeOtherFact(G, H) → Isomorphic(G, H) ?
29
Closing Remarks An invariant of a graph is a fact shared by all of its isomorphisms. Examples of invariants: - Number of vertices and edges - Degree sequence - Vertex chromatic number Even two graphs that share many facts, such as those octagonal graphs, may not be isomorphic.
30
This slide is intentionally left blank.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.