Exploration12
.pdf
keyboard_arrow_up
School
Georgia Institute Of Technology *
*We aren’t endorsed by this school
Course
1554
Subject
Industrial Engineering
Date
Dec 6, 2023
Type
Pages
2
Uploaded by PresidentMoon12744
clc
format
shortG
Problem 25: Compute PageRank and find the
smallest k for convergence
Define the Google matrix G for Problem 25
G1 = 0.85 * [
0
0
1/5 1
0;
1/3 0
1/5 0
1/2;
1/3 1/2 1/5
0
0;
1/3 0
1/5 0
1/2;
0
1/2 1/5 0
0
] + 0.15 * ones(5, 5) / 5;
% Compute PageRank for Problem 25 using the power method
pageRank1 = ones(5, 1) / 5;
% Initial guess for the PageRank vector
tolerance = 1e-4;
% convergence tolerance
delta = inf;
% change in PageRank vector
k = 0;
% iteration counter
while
delta > tolerance
pageRank1_new = G1 * pageRank1;
delta = norm(pageRank1_new - pageRank1);
pageRank1 = pageRank1_new;
k = k + 1;
end
% Display PageRank values
disp(
'PageRank for Problem 25:'
);
disp(pageRank1);
% Display the smallest k for convergence
disp([
'The smallest k for convergence to 4 significant digits in Problem 25
is: '
num2str(k)]);
PageRank for Problem 25:
0.23527
0.19789
0.21779
0.19789
0.15115
The smallest k for convergence to 4 significant digits in Problem 25 is: 14
Problem 26: Compute PageRank and find the
smallest k for convergence
Define the Google matrix G for Problem 26
1
G2 = 0.85 * [
1/6 0
1/6 0
1/4 1/2;
1/6 0
1/6 1/2 1/4
0;
1/6 0
1/6 1/2
0 0;
1/6 1/2 1/6 0
1/4
1/2;
1/6 1/2 1/6 0
0 0;
1/6 0
1/6 0 1/4 0
] + 0.15 * ones(6, 6) / 6;
% Compute PageRank for Problem 26 using the power method
pageRank2 = ones(6, 1) / 6;
% Initial guess for the PageRank vector
delta = inf;
% change in PageRank vector
k = 0;
% iteration counter
while
delta > tolerance
pageRank2_new = G2 * pageRank2;
delta = norm(pageRank2_new - pageRank2);
pageRank2 = pageRank2_new;
k = k + 1;
end
% Display PageRank values
disp(
'PageRank for Problem 26:'
);
disp(pageRank2);
% Display the smallest k for convergence
disp([
'The smallest k for convergence to 4 significant digits in Problem 26
is: '
num2str(k)]);
PageRank for Problem 26:
0.14552
0.2001
0.1673
0.23058
0.15438
0.10212
The smallest k for convergence to 4 significant digits in Problem 26 is: 11
Answer Questions:
Q1: Which model (linear, quadratic, cubic) would best fit the PageRank data? Ans1: The PageRank does not
typically fit into a linear, quadratic, or cubic model as it represents a steady-state distribution of a Markov process. It
is not modeled based on a polynomial regression but on a stochastic process.
% Q2: What does the value of the error ||G^k - Pi|| represent in the context
of PageRank?
% Ans2: The error represents the difference between the computed PageRank
vector at iteration k and the true steady-state distribution (Pi). A smaller
error indicates convergence to the steady state.
Published with MATLAB® R2023b
2
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
- Access to all documents
- Unlimited textbook solutions
- 24/7 expert homework help