Ryerson Crest Ryerson Header

MTH 607 Graph Theory Lab 4

  1. For each of the following find the order of the given function.
    1. f(x) = x2 + 2x
    2. f(x) = 17 + 24 × 5
    3. f(n) = 37n! + 2n
    4. f(x) = 4,982,734 + 49,827,420x + 3458291x2 + ½x3
    5. f(n) = (1 + n)log n
    6. f(n) = log [n(1 + n)]

  2. Show that for any positive functions f, g and h, if f(x) ∈ O(h(x)) and g(x) ∈ O(h(x)) then the function (af(x) + bg(x)) ∈ O(h(x)) for every real number a and b. (Hint: Use the limit definition of O, quote any properties of limits you use.)

  3. For this question let A =
    v1 v2 v3 v4 v5
    0 0 0 0 1
    0 0 1 1 0
    0 1 0 0 1
    0 1 0 0 1
    1 0 1 1 0
    1. Given the adjacency matrix A above, draw the corresponding graph G.
    2. Write down the corresponding adjcency list for G.
    3. Write down the corresponding adjcency table for G.
    4. Use the adjacency matrix method to find the number of paths of length 3 from v1 to v2. Identify these paths on your picture.
    5. Since there is no edge between v1 and v2 W0(v1, v2) = ∞. Without calculating them explain why W1(v1, v2) = W2(v1, v2) = ∞ Find Wk(v1, v2) for k = 3, 4 and 5.
    6. Draw the shortest path(s) from v1 to v2, how many are there?

    1. Given a graph with 1,000 vertices, if we use the "W" method to find the length of shortest path between to given points, roughly how many steps would you expect to use?
    2. Can you think of an algorithm based on matrix multiplication to find the shortest path between two given points?
    3. Given that matrix multiplication is roughly O(n2) what is the complexity of your algorithm?

  4. For each of the graphs below
    1. Find a DFS ordering of the vertices.
    2. Find a BFS ordering of the vertices.
    Graphs:
    NameBowtie Dumbell Extended Bowtie
    Start Central vertex One of the central vertices e


Maintained by: P. Danziger, February 2008.