{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Lab 12

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

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
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}