0% found this document useful (0 votes)
34 views4 pages

Eigenv

The document contains the results of calculating the eigenvalues and eigenvectors of three different matrices (G) representing web pages and their connections. For the first matrix, the eigenvalues range from -0.7203 to 1, with the highest eigenvector value of 0.4 corresponding to page 5, ranking it first. For the second matrix, all eigenvalues are -0.2 except for 1, and all pages have an equal eigenvector value of 0.1667, ranking them equally. For the third matrix, the eigenvalues range from -0.4435 to 0.7971, and page 5 again has the highest eigenvector value of 0.4058, ranking it first.

Uploaded by

ars.alt.email
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
34 views4 pages

Eigenv

The document contains the results of calculating the eigenvalues and eigenvectors of three different matrices (G) representing web pages and their connections. For the first matrix, the eigenvalues range from -0.7203 to 1, with the highest eigenvector value of 0.4 corresponding to page 5, ranking it first. For the second matrix, all eigenvalues are -0.2 except for 1, and all pages have an equal eigenvector value of 0.1667, ranking them equally. For the third matrix, the eigenvalues range from -0.4435 to 0.7971, and page 5 again has the highest eigenvector value of 0.4058, ranking it first.

Uploaded by

ars.alt.email
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

disp('Question 3')

G=[0 0 0 0 1/2 0; 1/4 0 0 0 0 0; 0 1/2 0 0 0 0; 1/4 1/2 0 0 1/2 0; 1/4 0 1 1 0


1; 1/4 0 0 0 0 0]
eigenv(G)
disp('Question 4')
G=[0 1/5 1/5 1/5 1/5 1/5; 1/5 0 1/5 1/5 1/5 1/5; 1/5 1/5 0 1/5 1/5 1/5; 1/5
1/5 1/5 0 1/5 1/5; 1/5 1/5 1/5 1/5 0 1/5; 1/5 1/5 1/5 1/5 1/5 0]
eigenv(G)
disp('Question 5')
G=[0 0 0 0 1/2 0; 1/4 0 0 0 0 0; 0 1/2 0 0 0 0; 1/4 1/2 0 0 0 0; 1/4 0 1 1 0
1; 1/4 0 0 0 0 0]
eigenv(G)
function eigenv(A)
e=eig(A)
[V,~]=eig(A)
tol=0.00000001;
x0=[1/6; 1/6; 1/6; 1/6; 1/6; 1/6];
N=1000;
page_ranking(A,tol,x0,N)
end

Question 3

G =

0 0 0 0 0.5000 0
0.2500 0 0 0 0 0
0 0.5000 0 0 0 0
0.2500 0.5000 0 0 0.5000 0
0.2500 0 1.0000 1.0000 0 1.0000
0.2500 0 0 0 0 0

e =

1.0000 + 0.0000i
-0.1398 + 0.3924i
-0.1398 - 0.3924i
-0.7203 + 0.0000i
-0.0000 + 0.0000i
-0.0000 - 0.0000i

V =

Columns 1 through 4

-0.3771 + 0.0000i 0.5770 + 0.0000i 0.5770 + 0.0000i -0.4895 + 0.0000i


-0.0943 + 0.0000i -0.1163 - 0.3262i -0.1163 + 0.3262i 0.1699 + 0.0000i
-0.0471 + 0.0000i -0.3220 + 0.2629i -0.3220 - 0.2629i -0.1179 + 0.0000i
-0.5185 + 0.0000i 0.1388 - 0.0633i 0.1388 + 0.0633i -0.4375 + 0.0000i
-0.7542 + 0.0000i -0.1614 + 0.4529i -0.1614 - 0.4529i 0.7052 + 0.0000i

1
-0.0943 + 0.0000i -0.1163 - 0.3262i -0.1163 + 0.3262i 0.1699 + 0.0000i

Columns 5 through 6

-0.0000 + 0.0000i -0.0000 - 0.0000i


-0.0000 + 0.0000i -0.0000 - 0.0000i
-0.7044 + 0.0000i -0.7044 + 0.0000i
0.6570 - 0.1870i 0.6570 + 0.1870i
-0.0000 - 0.0000i -0.0000 + 0.0000i
0.0474 + 0.1870i 0.0474 - 0.1870i

Done after iterations:


55

Eigenvector:
0.2000
0.0500
0.0250
0.2750
0.4000
0.0500

Sorted: (columns are value, page no., rank)


0.4000 5.0000 1.0000
0.2750 4.0000 2.0000
0.2000 1.0000 3.0000
0.0500 2.0000 4.0000
0.0500 6.0000 5.0000
0.0250 3.0000 6.0000

Question 4

G =

0 0.2000 0.2000 0.2000 0.2000 0.2000


0.2000 0 0.2000 0.2000 0.2000 0.2000
0.2000 0.2000 0 0.2000 0.2000 0.2000
0.2000 0.2000 0.2000 0 0.2000 0.2000
0.2000 0.2000 0.2000 0.2000 0 0.2000
0.2000 0.2000 0.2000 0.2000 0.2000 0

e =

-0.2000
-0.2000
-0.2000
-0.2000
-0.2000
1.0000

V =

2
0.7071 -0.4082 -0.2497 0.1826 0.2664 0.4082
-0.7071 -0.4082 -0.2497 0.1826 0.2664 0.4082
-0.0000 0.8165 -0.2497 0.1826 0.2664 0.4082
-0.0000 -0.0000 0.8905 0.1826 0.0840 0.4082
-0.0000 -0.0000 -0.1413 0.1826 -0.8832 0.4082
0 0 0 -0.9129 0 0.4082

Done after iterations:


1

Eigenvector:
0.1667
0.1667
0.1667
0.1667
0.1667
0.1667

Sorted: (columns are value, page no., rank)


0.1667 1.0000 1.0000
0.1667 2.0000 2.0000
0.1667 3.0000 3.0000
0.1667 4.0000 4.0000
0.1667 5.0000 5.0000
0.1667 6.0000 6.0000

Question 5

G =

0 0 0 0 0.5000 0
0.2500 0 0 0 0 0
0 0.5000 0 0 0 0
0.2500 0.5000 0 0 0 0
0.2500 0 1.0000 1.0000 0 1.0000
0.2500 0 0 0 0 0

e =

0.7971 + 0.0000i
-0.1768 + 0.5677i
-0.1768 - 0.5677i
-0.4435 + 0.0000i
0.0000 + 0.0000i
-0.0000 + 0.0000i

V =

Columns 1 through 4

-0.4977 + 0.0000i -0.1687 - 0.5417i -0.1687 + 0.5417i -0.5943 + 0.0000i


-0.1561 + 0.0000i -0.1964 + 0.1354i -0.1964 - 0.1354i 0.3350 + 0.0000i

3
-0.0979 + 0.0000i 0.1578 + 0.1238i 0.1578 - 0.1238i -0.3776 + 0.0000i
-0.2540 + 0.0000i -0.0386 + 0.2593i -0.0386 - 0.2593i -0.0426 + 0.0000i
-0.7934 + 0.0000i 0.6748 + 0.0000i 0.6748 + 0.0000i 0.5272 + 0.0000i
-0.1561 + 0.0000i -0.1964 + 0.1354i -0.1964 - 0.1354i 0.3350 + 0.0000i

Columns 5 through 6

-0.0000 + 0.0000i 0.0000 + 0.0000i


0.0000 + 0.0000i 0.0000 + 0.0000i
0.2546 + 0.0000i -0.7598 + 0.0000i
-0.7991 + 0.0000i 0.6389 + 0.0000i
-0.0000 + 0.0000i 0.0000 + 0.0000i
0.5446 + 0.0000i 0.1209 + 0.0000i

Done after iterations:


62

Eigenvector:
0.2545
0.0798
0.0501
0.1299
0.4058
0.0798

Sorted: (columns are value, page no., rank)


0.4058 5.0000 1.0000
0.2545 1.0000 2.0000
0.1299 4.0000 3.0000
0.0798 2.0000 4.0000
0.0798 6.0000 5.0000
0.0501 3.0000 6.0000

Published with MATLAB® R2022a

You might also like