Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 5

MAT214A

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

∑ deg ⁡(v ¿¿ i)=2 m ¿


i=1

The sum of the degrees of all vertices is even.


In addition: the number of vertices of odd degree must be even

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.

Vertex Distance from source Previous vertex


a 0
b ∞ 7 4 c
c ∞3
d ∞5 c
e ∞9 d

Result is a – c – d – e for distance of 9


I actually liked the tree method from class better, Zach and Jacqueline method:
Section 8-2 Paths and Cycles
Path: Let v0 and vn be vertices on a graph. A path from v0 to vn of length n, is an alternating sequence of n + 1
vertices and n edges beginning with v0 and ending with vn.
This is very formal language. It means start at v0; go along edge e1 to v1, go along edge e2 to v2; etc. Notice that
the definition in this book allows repetitions of vertices or edges or both. This is not always the case – check
definitions in other textbooks.
The length of the path is the number of edges (n) that the path contains.

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

Connected Graph: given any vertices v and w, there is a path from v to w


We can get from any vertex to any other vertex.

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.]

All of these graphs are subgraphs of the first 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 with 3 components:

A graph that is itself connected has exactly one component, consisting of the whole graph.

Component versus Subgraph


One standard way to categorize graphs is as connected or disconnected. A disconnected graph can be
decomposed into a series of graphs that are not connected to each other. I would refer to one of those as a
component. A subgraph on the other hand is a subset of vertices of the original graph along with a subset of
edges.

46

---------------Stopped here --------------------

You might also like