Lab12 - 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

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

View Full Document Right Arrow Icon
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
Background image of page 1

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

View Full DocumentRight Arrow Icon
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. degrees=sum(g1) degrees = 2 4 3 5 5 3 3 3 3 1 NumberEdges=sum(sum(g1))/2 NumberEdges = 16 4. Find the distance from vertex #6 to vertex #1 using matlab commands. i = 1; A = g1; n = size(A,2); disEq0 = zeros(1,n);
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This homework help was uploaded on 04/17/2008 for the course MAP 2480 taught by Professor Monicahurdal during the Fall '07 term at FSU.

Page1 / 7

Lab12 - 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

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online