Home License -- for personal use only. Not for government, academic, research, commercial, or other organizational use. 07-Oct-2025 23:14:07 pagerank_test(): MATLAB/Octave version 9.11.0.2358333 (R2021b) Update 7 Test pagerank(). Test 1 5 node MacCormick example with a cycle A = 0 1 0 0 0 0 0 0 0 1 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 T = 0 0 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 google_rank(): Given an NxN adjacency matrix A, compute the Google matrix G, Then start with a vector of N values 1/N, and repeatedly compute x <= G*x After many steps, compare last three iterates. If they are close, we are probably at an eigenvector associated with the eigenvalue 1. x, G*x, G*G*x 0.3322 0.3322 0.3322 0.3123 0.3123 0.3123 0.0300 0.0300 0.0300 0.0300 0.0300 0.0300 0.2955 0.2955 0.2955 power_rank(): Given an NxN adjacency matrix A, compute the transition matrix T, Then start with a vector of N values 1/N, and repeatedly compute x <= T*x After many steps, compare last three iterates. If they are close, we are probably at an eigenvector associated with the eigenvalue 1. x, T*x, T*T*x 0.6000 0.2000 0.2000 0.2000 0.6000 0.2000 0 0 0 0 0 0 0.2000 0.2000 0.6000 surf_rank(): Given an NxN adjacency matrix A, compute the Google matrix T, and then repeatedly visit nodes, keeping track of how often you visited. 15 per cent of the time, simply take a random jump to a node. The rest of the time, follow a random link from the current node. When done, the node weight is the number of visits normalized by the total number of visits. Node weights: 0.3318 0.3128 0.0304 0.0300 0.2949 Test 2 16 node MacCormick example A = Columns 1 through 13 0 1 1 0 0 1 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 1 0 1 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 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 1 0 0 0 1 1 1 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 1 0 0 0 0 0 0 0 0 0 0 0 0 Columns 14 through 16 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 1 0 0 1 0 0 1 0 0 1 0 0 0 1 0 0 0 T = Columns 1 through 7 0 0 0 0 0 0 0 0.3333 0 0 0 0 0 0 0.3333 0 0 0 0 0 0 0 1.0000 0.5000 0 0 0 0 0 0 0.5000 1.0000 0 0.5000 0 0.3333 0 0 0 0 0 0 0 0 0 0 0.5000 0.5000 0 0 0 0 0 0.5000 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 1.0000 0 0 0 0 0 0 0 Columns 8 through 14 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.3333 0 0.2000 0 0 0 0 0 0 0 0 0 0 0 0.3333 0 0 0 0 0 0 0.3333 1.0000 0 0 0 0 0 0 0 0.2000 0 0 0 0 0 0 0.2000 0 0 0 0 0 0 0.2000 0 0 0 0 0 0 0.2000 0 0 0 0 0 0 0 1.0000 1.0000 1.0000 1.0000 0 0 0 0 0 0 0 Columns 15 through 16 0 1.0000 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 1.0000 0 google_rank(): Given an NxN adjacency matrix A, compute the Google matrix G, Then start with a vector of N values 1/N, and repeatedly compute x <= G*x After many steps, compare last three iterates. If they are close, we are probably at an eigenvector associated with the eigenvalue 1. x, G*x, G*G*x 0.1246 0.1246 0.1246 0.0447 0.0447 0.0447 0.0447 0.0447 0.0447 0.0664 0.0664 0.0664 0.1038 0.1038 0.1038 0.0447 0.0447 0.0447 0.0953 0.0953 0.0953 0.0535 0.0535 0.0535 0.0245 0.0245 0.0245 0.0454 0.0454 0.0454 0.0171 0.0171 0.0171 0.0171 0.0171 0.0171 0.0171 0.0171 0.0171 0.0171 0.0171 0.0171 0.1485 0.1485 0.1485 0.1356 0.1356 0.1356 power_rank(): Given an NxN adjacency matrix A, compute the transition matrix T, Then start with a vector of N values 1/N, and repeatedly compute x <= T*x After many steps, compare last three iterates. If they are close, we are probably at an eigenvector associated with the eigenvalue 1. x, T*x, T*T*x 0.1395 0.1395 0.1395 0.0465 0.0465 0.0465 0.0465 0.0465 0.0465 0.0698 0.0698 0.0698 0.1163 0.1163 0.1163 0.0465 0.0465 0.0465 0.1085 0.1085 0.1085 0.0581 0.0581 0.0581 0.0194 0.0194 0.0194 0.0388 0.0388 0.0388 0.0078 0.0078 0.0078 0.0078 0.0078 0.0078 0.0078 0.0078 0.0078 0.0078 0.0078 0.0078 0.1395 0.1395 0.1395 0.1395 0.1395 0.1395 surf_rank(): Given an NxN adjacency matrix A, compute the Google matrix T, and then repeatedly visit nodes, keeping track of how often you visited. 15 per cent of the time, simply take a random jump to a node. The rest of the time, follow a random link from the current node. When done, the node weight is the number of visits normalized by the total number of visits. Node weights: Columns 1 through 7 0.1247 0.0441 0.0455 0.0661 0.1031 0.0442 0.0944 Columns 8 through 14 0.0536 0.0247 0.0458 0.0174 0.0174 0.0175 0.0172 Columns 15 through 16 0.1487 0.1356 Test 3 6 node Moler example A = 0 1 0 0 0 1 0 0 1 1 0 0 0 0 0 1 1 1 1 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 T = 0 0 0 1.0000 0 1.0000 0.5000 0 0 0 0 0 0 0.5000 0 0 0 0 0 0.5000 0.3333 0 0 0 0 0 0.3333 0 1.0000 0 0.5000 0 0.3333 0 0 0 google_rank(): Given an NxN adjacency matrix A, compute the Google matrix G, Then start with a vector of N values 1/N, and repeatedly compute x <= G*x After many steps, compare last three iterates. If they are close, we are probably at an eigenvector associated with the eigenvalue 1. x, G*x, G*G*x 0.2353 0.2353 0.2353 0.1250 0.1250 0.1250 0.0781 0.0781 0.0781 0.1003 0.1003 0.1003 0.3142 0.3142 0.3142 0.1471 0.1471 0.1471 power_rank(): Given an NxN adjacency matrix A, compute the transition matrix T, Then start with a vector of N values 1/N, and repeatedly compute x <= T*x After many steps, compare last three iterates. If they are close, we are probably at an eigenvector associated with the eigenvalue 1. x, T*x, T*T*x 0.0110 0.0106 0.0103 0.0057 0.0055 0.0053 0.0029 0.0028 0.0027 0.0039 0.0038 0.0037 0.9698 0.9708 0.9718 0.0067 0.0065 0.0062 surf_rank(): Given an NxN adjacency matrix A, compute the Google matrix T, and then repeatedly visit nodes, keeping track of how often you visited. 15 per cent of the time, simply take a random jump to a node. The rest of the time, follow a random link from the current node. When done, the node weight is the number of visits normalized by the total number of visits. Node weights: 0.2349 0.1251 0.0774 0.0996 0.3160 0.1471 Test 4 6 node example A = 0 1 0 0 0 0 0 0 1 0 1 0 1 0 0 1 0 0 1 0 0 0 0 0 0 1 0 0 0 1 0 0 0 1 0 0 T = 0 0 0.5000 1.0000 0 0 1.0000 0 0 0 0.5000 0 0 0.5000 0 0 0 0 0 0 0.5000 0 0 1.0000 0 0.5000 0 0 0 0 0 0 0 0 0.5000 0 google_rank(): Given an NxN adjacency matrix A, compute the Google matrix G, Then start with a vector of N values 1/N, and repeatedly compute x <= G*x After many steps, compare last three iterates. If they are close, we are probably at an eigenvector associated with the eigenvalue 1. x, G*x, G*G*x 0.2159 0.2159 0.2159 0.2675 0.2675 0.2675 0.1387 0.1387 0.1387 0.1553 0.1553 0.1553 0.1387 0.1387 0.1387 0.0839 0.0839 0.0839 power_rank(): Given an NxN adjacency matrix A, compute the transition matrix T, Then start with a vector of N values 1/N, and repeatedly compute x <= T*x After many steps, compare last three iterates. If they are close, we are probably at an eigenvector associated with the eigenvalue 1. x, T*x, T*T*x 0.2143 0.2143 0.2143 0.2857 0.2857 0.2857 0.1429 0.1429 0.1429 0.1429 0.1429 0.1429 0.1429 0.1429 0.1429 0.0714 0.0714 0.0714 surf_rank(): Given an NxN adjacency matrix A, compute the Google matrix T, and then repeatedly visit nodes, keeping track of how often you visited. 15 per cent of the time, simply take a random jump to a node. The rest of the time, follow a random link from the current node. When done, the node weight is the number of visits normalized by the total number of visits. Node weights: 0.2172 0.2665 0.1386 0.1549 0.1379 0.0848 Test 5 15 node Sauer example A = Columns 1 through 13 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 1 0 1 0 0 0 0 0 0 0 1 0 0 0 1 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 1 1 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 1 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 1 0 0 0 0 0 0 0 0 0 0 0 1 0 Columns 14 through 15 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 1 0 0 1 1 0 T = Columns 1 through 7 0 0 0 0 0.5000 0 0 0.5000 0 0.3333 0 0 0 0 0 0.3333 0 0.5000 0 0 0 0 0 0 0 0 0 0 0 0.3333 0 0 0 0 0 0 0 0.3333 0 0 0 0 0 0.3333 0 0 0 0 0 0 0 0.3333 0 0 0 0 0.5000 0 0 0 0 0 0 0 0 0 0 0.5000 0.5000 0.5000 0 0 0 0 0 0.5000 0.5000 0 0 0 0.5000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 8 through 14 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.5000 0 0 0 0 0 0 0 0.3333 0 0 0 0 0 0 0.3333 0 0 0 0 0 0 0 0 0 0.3333 0 0 0 0 0 0 0.3333 0 0 0 0 0 0 0 0.5000 0 0 0.3333 0 0 0 0 0.2500 0.5000 0 0 0 0.3333 0 0.2500 0 0 0 0 0 0 0 0 0 1.0000 0 0 0 0.2500 0 0 0 0 0 0.5000 0 0 0 0 1.0000 0 0 0.2500 Column 15 0 0 0 0 0 0 0 0 0 0 0 0.5000 0 0.5000 0 google_rank(): Given an NxN adjacency matrix A, compute the Google matrix G, Then start with a vector of N values 1/N, and repeatedly compute x <= G*x After many steps, compare last three iterates. If they are close, we are probably at an eigenvector associated with the eigenvalue 1. x, G*x, G*G*x 0.0268 0.0268 0.0268 0.0299 0.0299 0.0299 0.0299 0.0299 0.0299 0.0268 0.0268 0.0268 0.0396 0.0396 0.0396 0.0396 0.0396 0.0396 0.0396 0.0396 0.0396 0.0396 0.0396 0.0396 0.0746 0.0746 0.0746 0.1063 0.1063 0.1063 0.1063 0.1063 0.1063 0.0746 0.0746 0.0746 0.1251 0.1251 0.1251 0.1163 0.1163 0.1163 0.1251 0.1251 0.1251 power_rank(): Given an NxN adjacency matrix A, compute the transition matrix T, Then start with a vector of N values 1/N, and repeatedly compute x <= T*x After many steps, compare last three iterates. If they are close, we are probably at an eigenvector associated with the eigenvalue 1. x, T*x, T*T*x 0.0154 0.0154 0.0154 0.0116 0.0116 0.0116 0.0116 0.0116 0.0116 0.0154 0.0154 0.0154 0.0309 0.0309 0.0309 0.0309 0.0309 0.0309 0.0309 0.0309 0.0309 0.0309 0.0309 0.0309 0.0811 0.0811 0.0811 0.1100 0.1100 0.1100 0.1100 0.1100 0.1100 0.0811 0.0811 0.0811 0.1467 0.1467 0.1467 0.1467 0.1467 0.1467 0.1467 0.1467 0.1467 surf_rank(): Given an NxN adjacency matrix A, compute the Google matrix T, and then repeatedly visit nodes, keeping track of how often you visited. 15 per cent of the time, simply take a random jump to a node. The rest of the time, follow a random link from the current node. When done, the node weight is the number of visits normalized by the total number of visits. Node weights: Columns 1 through 7 0.0266 0.0294 0.0292 0.0269 0.0391 0.0405 0.0401 Columns 8 through 14 0.0386 0.0755 0.1064 0.1059 0.0738 0.1265 0.1168 Column 15 0.1246 pagerank_test(): Normal end of execution. 07-Oct-2025 23:14:16