# Graph theory worksheet

**CSS 220 Module 7 In-Class Activity**

Graph theory worksheet:

A graph is something that looks like this. It has vertices, and edges. Each edge connects two vertices. It is used to model various things where there are “connections”. For example, it could be cities and roads between them, or it could be the graph of friendship between people: each vertex is a person and two people are connected by an edge if they are friends. There is no interaction between edges that intersect in the middle.

1. How many vertices are there in the above graph? How many edges?

2. What is the order of this graph?

3. Can you list the vertices of the graph? Can you list the connections? (this is like giving the ‘friend list’ for each person)

4. In the above graph, how many vertices of degree 1, 2, 3, 4, 5 are there?

5. Make a graph with 5 vertices where each vertex has degree 2.

6. Can you make a graph with 5 vertices where each vertex has degree 3 instead of degree 2. Is this possible? Why?

A clique is a group of vertices that are all connected to each other (e.g. a group of people who are all friends with each other). A k-clique in a graph is a clique with k people in it.

7.

How many 2-cliques are there in the above graph? How many 3-cliques? How many 4-cliques?

8. List 4 paths that go from vertex 1 to vertex 6?

9. What is the length of the shortest path from vertex 1 to vertex 6? How many edges does it have?

A graph with n vertices where every two vertices are connected to each other is called a fully connected graph. Also called a K_n (everyone’s friends, in fact best friends)

10. Can you draw a K_5, a K_6? Think about how may edges do you need to draw for each.

11. In K_n, how many edges are there?

12. How many k-cliques are there in K_n?

13. You are visiting the Guggenheim Museum in New York City. Consider representing the museum as a graph where the works of art are the vertices and paths between adjacent works of art are the edges. We want to see each work of art exactly once. Would this path be represented by an Euler circuit or a Hamiltonian circuit?

14.

Consider the graph given above. Use the nearest neighbor algorithm to find the Hamiltonian circuit starting at vertex L.

a. List the vertices in the Hamiltonian circuit in the order they are visited. Do not forget to include the starting vertex at both ends.

b. What is the total weight along the Hamiltonian circuit?

15.

Consider the graph given above. Use the nearest neighbor algorithm to find the Hamiltonian circuit starting at vertex N.

a. List the vertices in the Hamiltonian circuit in the order they are visited. Do not forget to include the starting vertex at both ends.

b. What is the total weight along the Hamiltonian circuit?