Lab12

# Lab12 - Name Ryan Corley Section 4 Problems for lab 12 Part...

This preview shows pages 1–3. Sign up to view the full content.

Name: Ryan Corley Section: 4 Problems for lab 12. Part A: Six degrees of separation: It is said that it takes at most six steps to get from any one to any one else. The connections might be friendship; movies actors co-star in, or scientists that co-authored a paper. We consider ten people with the connections given by the graph below. 1. Use the adjacency matrix A below to define a graph [0 1 1 0 0 0 0 0 0 0 ] [1 0 1 1 1 0 0 0 0 0 ] [1 1 0 1 0 0 0 0 0 0 ] [0 1 1 0 1 1 1 0 0 0 ] [0 1 0 1 0 1 0 1 1 0 ] [0 0 0 1 1 0 1 0 0 0 ] [0 0 0 1 0 1 0 1 0 0 ] [0 0 0 0 1 0 1 0 1 0 ] [0 0 0 0 1 0 0 1 0 1 ] [0 0 0 0 0 0 0 0 1 0 ] g1=[0 1 1 0 0 0 0 0 0 0 ;1 0 1 1 1 0 0 0 0 0 ;1 1 0 1 0 0 0 0 0 0 ;0 1 1 0 1 1 1 0 0 0 ;0 1 0 1 0 1 0 1 1 0 ;0 0 0 1 1 0 1 0 0 0 ;0 0 0 1 0 1 0 1 0 0 ;0 0 0 0 1 0 1 0 1 0 ;0 0 0 0 1 0 0 1 0 1 ;0 0 0 0 0 0 0 0 1 0 ] g1 = 0 1 1 0 0 0 0 0 0 0 1 0 1 1 1 0 0 0 0 0 1 1 0 1 0 0 0 0 0 0 0 1 1 0 1 1 1 0 0 0 0 1 0 1 0 1 0 1 1 0 0 0 0 1 1 0 1 0 0 0 0 0 0 1 0 1 0 1 0 0 0 0 0 0 1 0 1 0 1 0 0 0 0 0 1 0 0 1 0 1 0 0 0 0 0 0 0 0 1 0 g1-g1' ans = 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2. Plot the graph (need plotgraph.m, then type `help plotgraph') help plotgraph

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
plotgraph(g1) -1 -0.5 0 0.5 1 -1 -0.5 0 0.5 1 1 2 3 4 5 6 7 8 9 : 3. Find all the degrees of all the vertices and the number of edges in the graph.
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern