Home License -- for personal use only. Not for government, academic, research, commercial, or other organizational use. 13-May-2025 16:14:23 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.3328 0.3124 0.0298 0.0306 0.2944 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.1252 0.0455 0.0449 0.0673 0.1033 0.0442 0.0958 Columns 8 through 14 0.0536 0.0246 0.0455 0.0170 0.0169 0.0168 0.0170 Columns 15 through 16 0.1474 0.1349 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.2364 0.1259 0.0778 0.1017 0.3111 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.2158 0.2677 0.1399 0.1562 0.1385 0.0819 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.0263 0.0307 0.0312 0.0273 0.0399 0.0386 0.0381 Columns 8 through 14 0.0400 0.0743 0.1063 0.1057 0.0739 0.1253 0.1175 Column 15 0.1249 pagerank_test(): Normal end of execution. 13-May-2025 16:14:31