Docsity

CS200 Fall 2007 Homework 4 Solutions - Prof. Adele E. Howe, Assignments of Computer Science

Toggle sidebar
bg1
CS200 Fall 2007 HW 4 due 11/20/08 by 9:30AM
Notes about what is handed in: Your assignment must be legible and neat with the answers
clearly indicated . If your assignment takes multiple pag es, the pages must be stapled together
before they are h anded in. You will lose points if you do not follow these guidelines.
1. For each of the following graphs (a, b and c),
a. determine i.) whether the graph has directed or undirected edges, ii.) whether it has
multiple edges, and iii.) whether it has one or more loops. iv.) Use these answers to
determine the type of graph (as described in Table 1 in Ch. 9.1 in Rosen). Each of these
graphs were taken from different sources and different applications and so display slightly
differently. You can ignore the labels on the edges and the fact that some nodes display
differently.
b. For graph a, change it as minimally as possible to prod uce a simple graph.
c. For graph b, find the number of vertices , the number of edges, the set of values for degree
for the vertices and the number of vertices that are pendant. Show that the sum of the
degrees of the vertices equal twice the number of edges.
2. Draw the graphs C7 and K7. Are they bipartite?
a
b
c
pf2

Partial preview of the text

Download CS200 Fall 2007 Homework 4 Solutions - Prof. Adele E. Howe and more Assignments Computer Science in PDF only on Docsity!

CS200 Fall 2007 HW 4 due 11/20/08 by 9:30AM

Notes about what is handed in: Your assignment must be legible and neat with the answers clearly indicated. If your assignment takes multiple pages, the pages must be stapled together before they are handed in. You will lose points if you do not follow these guidelines.

  1. For each of the following graphs (a, b and c), a. determine i.) whether the graph has directed or undirected edges, ii.) whether it has multiple edges, and iii.) whether it has one or more loops. iv.) Use these answers to determine the type of graph (as described in Table 1 in Ch. 9.1 in Rosen). Each of these graphs were taken from different sources and different applications and so display slightly differently. You can ignore the labels on the edges and the fact that some nodes display differently. b. For graph a, change it as minimally as possible to produce a simple graph. c. For graph b, find the number of vertices, the number of edges, the set of values for degree for the vertices and the number of vertices that are pendant. Show that the sum of the degrees of the vertices equal twice the number of edges.
  2. Draw the graphs C7 and K7. Are they bipartite?

a b

c

  1. Represent the following graph using a) an adjacency matrix and b) an adjacency list.
  2. For each of the graphs a, b, c, and d, state whether it is strongly connected and if not, if it is weakly connected.
  3. For the graph a, a. construct the depth first traversal assuming that you start from vertex 1 and when given a choice, you pick the vertex with the lowest number. b. use Dijkstra’s algorithm to find the shortest path between vertex 1 and 13. Report the path and its cost, and show the table constructed.

d