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.
No two dif
9.3 Representing Graphs
u1, u3, u4
u2, u3, u5
u1, u2, u4
Order the vertices in some way
V1, V2, ., Vn , the adjacency matrix is an n-by-n
Recursive Algorithm (4.4)
An algorithm is called recursive if it solves a problem by
reducing it to an instance of the same problem with smaller
Example: Computing n!
Procedure factorial ( n : nonnegative integer)
if n= 0 then factorial(n)=1
1. Quiz 5 due tomorrow afternoon in E309 from
1pm to 4pm.
2. Homework grades will be based on ten graded
homework assignments (dropping the lowest
3. Final Exam will be on Thursday April 30,
12:30pm to 2:30pm.
4. Review problems (for the final) will
3.3 Complexity of Algorithms
Linear Search Algorithm
Determine if 3 is in the following lists
A= cfw_ 1 4 8 -1 2
B= cfw_ 3 4 8 6 5
C= cfw_ 1 2 4 9 10 11 12 14 19 10 -11 0
D= cfw_ 1 3 2 4
For each list ( problem ), how much time will the
No edges between vertices in V1 or V2
This is a bipartite graph but not a complete
bipartite graph ( so it is NOT K6, 4 ).
cfw_a, b, d , cfw_c, e, f, g
How many vertices and edges in Km, n?
If a is in V1, then, b, d, e must be in
COT3100: Strong Induction (Sec 4.2)
If you know how to
Slup I: + I
0 Reach the first step of a ladder
0 Reach step ls + 1, if we can reach all the first
Then, you can reach any step of the ladder.
1: can reach