Professional Documents
Culture Documents
MAT214ALecture4 3
MAT214ALecture4 3
Wednesday 4/3
Spring 2019 10:50 am – 12:05 pm
Test#2 on 3.1-3.3, 6.1-6.3, 6.8, 7.1-7.2 graded – hand back
Homework for Section 8-2: #1-18 even, 22-26 all, 28-32, 35, 36, 42, 46, 48, 49
Quiz on 8.1 – 8.2 on Friday
Last time: Section 8.1 Intro to Graph Theory and Section 8-2 Paths and Cycles
A graph G consists of: a set V of vertices and a set E of edges.
Vocabulary
Degree of vertex v [The book uses ẟ(v) for degree of vertex. The letter ẟ is a lower case delta. Many
books write deg(v) to designate the degree of a vertex. Either notation is fine.]
Order of a graph
Size of a graph
Euler Cycle
Euler Path
Bipartite Graph
Theorem (Handshake Lemma): If a graph has m edges and vertices {v1, v2, v3, ….vn}, then
n
Question in class: Can a graph have an infinite number of edges? – Yes, example would be an infinite grid
graph where vertices are the positions where the grid lines meet. This graph has V = all intersection point of
grid. The edges are e[(0,0), (1,0)], e[(1,0), (1,1)], etc.
Last topic from Section 8-1
A weighted graph has a value (weight) associated with each edge. The weight is like the “cost” or the
“distance” between vertices.
Def
Similar example for homework question: Find the shortest path from vertex a to vertex e.
3 7
c 1 b
2 2 6
d e
4
Shortest path from a to e? Create shortest path tree that keeps track of all vertices on shortest path. (Dijkstra
lite)
1. Every time that we set out to visit a new vertex, we will choose the vertex with the smallest known
distance/cost to visit first.
2. Once we’ve moved to the vertex we’re going to visit, we will check each of its neighboring vertices.
3. For each neighboring vertex, we’ll calculate the distance/cost for the neighboring vertices by summing
the cost of the edges that lead to the vertex we’re checking from the starting vertex.
4. Finally, if the distance/cost to a node is less than a known distance, we’ll update the shortest distance
that we have on file for that vertex.
E2 E3
E6 E7
E4
E1
E5
In the graph above, (v1, E1, v2, E2, v3, E3, v4) is a path from v1 to v4 of length 3.
If there are no parallel edges, we can write (v1, v2, v3, v4) is a path from v1 to v4
More definitions:
Simple path: path from v0 and vn with no repeated vertices. The path given above is a simple path.
Cycle: a path of nonzero length from vn to vn with no repeated edges. (starts and ends at same place)
Simple Cycle: a cycle from vn to vn in which there are no repeated vertices – except for beginning and end at
vn.
(v1, E1, v2, E2, v3, E3, v4, E7, v1) is a cycle (no repeated edges) and is also a simple cycle (no repeated vertices)
Homework #3-9 odd
Homework #48
Subgraph of G:
Recall that a graph G consists of: a set V of vertices and a set E of edges
A subgraph S of a graph G is a graph whose set of vertices and set of edges are all subsets of G. (Since every set
is a subset of itself, every graph is a subgraph of itself.)
So, Let G = (V, E) be a graph
Then S = (V’, E’) is a subgraph of G if
V’ ⊆ V and E’ ⊆ E
For every edge e’ ∈ E’, if e’ is incident on vertices v’ and w’, then v’ and w’ must belong to V’
[This is saying: any edge that connects two vertices in the subgraph will also connect the corresponding
vertices in the parent graph.]
Homework #25
Component of a Graph
A component, sometimes called a connected component, of an undirected graph is a subgraph in which any
two vertices are connected to each other by paths, and which is connected to no additional vertices in
the parent graph.
For example, the graph shown has two components. A vertex with no incident edges is itself a component.
A graph that is itself connected has exactly one component, consisting of the whole graph.
46