24-Sep-2022 10:36:31 pagerank_test(): MATLAB/Octave version 4.2.2 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 incidence 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 1: 0.332167 0.332167 0.332167 2: 0.312342 0.312342 0.312342 3: 0.03 0.03 0.03 4: 0.03 0.03 0.03 5: 0.295491 0.295491 0.295491 power_rank(): Given an NxN incidence 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 1: 0.6 0.2 0.2 2: 0.2 0.6 0.2 3: 0 0 0 4: 0 0 0 5: 0.2 0.2 0.6 surf_rank(): Given an NxN incidence 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: 1: 0.33207 2: 0.31221 3: 0.03037 4: 0.03003 5: 0.29532 Test 2 16 node MacCormick example A = 0 1 1 0 0 1 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 1 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 1 1 0 0 0 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 1 0 0 0 0 0 0 0 1 0 1 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 1 0 0 0 1 1 1 1 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 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 1 0 0 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 0 0 0 0 0 0 T = Columns 1 through 8: 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.33333 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.33333 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 1.00000 0.50000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.50000 1.00000 0.00000 0.50000 0.00000 0.00000 0.33333 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.50000 0.50000 0.00000 0.33333 0.00000 0.00000 0.00000 0.00000 0.50000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.33333 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.33333 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 1.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 Columns 9 through 16: 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 1.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.20000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 1.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.20000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.20000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.20000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.20000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 1.00000 1.00000 1.00000 1.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 1.00000 0.00000 google_rank(): Given an NxN incidence 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 1: 0.124641 0.124641 0.124641 2: 0.0446898 0.0446898 0.0446898 3: 0.0446898 0.0446898 0.0446898 4: 0.0663545 0.0663545 0.0663545 5: 0.103763 0.103763 0.103763 6: 0.0446898 0.0446898 0.0446898 7: 0.0953317 0.0953317 0.0953317 8: 0.0534741 0.0534741 0.0534741 9: 0.024526 0.024526 0.024526 10: 0.0453731 0.0453731 0.0453731 11: 0.0170884 0.0170884 0.0170884 12: 0.0170884 0.0170884 0.0170884 13: 0.0170884 0.0170884 0.0170884 14: 0.0170884 0.0170884 0.0170884 15: 0.148508 0.148508 0.148508 16: 0.135606 0.135606 0.135606 power_rank(): Given an NxN incidence 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 1: 0.139535 0.139535 0.139535 2: 0.0465117 0.0465117 0.0465117 3: 0.0465117 0.0465117 0.0465117 4: 0.0697674 0.0697675 0.0697675 5: 0.116279 0.116279 0.116279 6: 0.0465117 0.0465117 0.0465117 7: 0.108527 0.108527 0.108527 8: 0.0581394 0.0581395 0.0581396 9: 0.0193798 0.0193798 0.0193798 10: 0.0387597 0.0387596 0.0387596 11: 0.00775194 0.00775193 0.00775193 12: 0.00775194 0.00775193 0.00775193 13: 0.00775194 0.00775193 0.00775193 14: 0.00775194 0.00775193 0.00775193 15: 0.139535 0.139535 0.139535 16: 0.139535 0.139535 0.139535 surf_rank(): Given an NxN incidence 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: 1: 0.12463 2: 0.04484 3: 0.04444 4: 0.06597 5: 0.1037 6: 0.04538 7: 0.09565 8: 0.05275 9: 0.02418 10: 0.0446 11: 0.01651 12: 0.01796 13: 0.01692 14: 0.01715 15: 0.14909 16: 0.13623 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.00000 0.00000 0.00000 1.00000 0.00000 1.00000 0.50000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.50000 0.00000 0.00000 0.00000 0.00000 0.00000 0.50000 0.33333 0.00000 0.00000 0.00000 0.00000 0.00000 0.33333 0.00000 1.00000 0.00000 0.50000 0.00000 0.33333 0.00000 0.00000 0.00000 google_rank(): Given an NxN incidence 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 1: 0.235275 0.235275 0.235275 2: 0.124992 0.124992 0.124992 3: 0.0781215 0.0781215 0.0781215 4: 0.100256 0.100256 0.100256 5: 0.31423 0.31423 0.31423 6: 0.147126 0.147126 0.147126 power_rank(): Given an NxN incidence 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 1: 0.0109619 0.0106074 0.0102642 2: 0.00566419 0.00548097 0.00530368 3: 0.00292677 0.0028321 0.00274049 4: 0.00393497 0.00380768 0.00368452 5: 0.96984 0.970815 0.971759 6: 0.00667239 0.00645656 0.00624771 surf_rank(): Given an NxN incidence 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: 1: 0.23273 2: 0.12323 3: 0.07816 4: 0.09842 5: 0.32149 6: 0.14597 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.00000 0.00000 0.50000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 0.00000 0.50000 0.00000 0.00000 0.50000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.50000 0.00000 0.00000 1.00000 0.00000 0.50000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.50000 0.00000 google_rank(): Given an NxN incidence 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 1: 0.215933 0.215933 0.215933 2: 0.267482 0.267482 0.267482 3: 0.13868 0.13868 0.13868 4: 0.155287 0.155287 0.155287 5: 0.13868 0.13868 0.13868 6: 0.0839389 0.0839389 0.0839389 power_rank(): Given an NxN incidence 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 1: 0.214286 0.214286 0.214286 2: 0.285714 0.285714 0.285714 3: 0.142857 0.142857 0.142857 4: 0.142857 0.142857 0.142857 5: 0.142857 0.142857 0.142857 6: 0.0714286 0.0714286 0.0714286 surf_rank(): Given an NxN incidence 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: 1: 0.2171 2: 0.2672 3: 0.13888 4: 0.15501 5: 0.1377 6: 0.08411 Test 5 15 node Sauer example A = 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 1 0 1 0 0 0 0 0 0 0 0 0 1 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 1 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 0 0 0 0 1 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 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 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 1 1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 1 1 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 T = Columns 1 through 8: 0.00000 0.00000 0.00000 0.00000 0.50000 0.00000 0.00000 0.00000 0.50000 0.00000 0.33333 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.33333 0.00000 0.50000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.50000 0.00000 0.33333 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.33333 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.33333 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.33333 0.00000 0.00000 0.00000 0.00000 0.00000 0.50000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.50000 0.50000 0.50000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.50000 0.50000 0.50000 0.00000 0.00000 0.00000 0.50000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 Columns 9 through 15: 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.33333 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.33333 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.33333 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.33333 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.50000 0.00000 0.00000 0.33333 0.00000 0.00000 0.00000 0.00000 0.25000 0.00000 0.00000 0.00000 0.00000 0.33333 0.00000 0.25000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.50000 0.00000 1.00000 0.00000 0.00000 0.00000 0.25000 0.00000 0.00000 0.00000 0.00000 0.00000 0.50000 0.00000 0.50000 0.00000 0.00000 1.00000 0.00000 0.00000 0.25000 0.00000 google_rank(): Given an NxN incidence 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 1: 0.0268246 0.0268246 0.0268246 2: 0.0298611 0.0298611 0.0298611 3: 0.0298611 0.0298611 0.0298611 4: 0.0268246 0.0268246 0.0268246 5: 0.0395872 0.0395872 0.0395872 6: 0.0395872 0.0395872 0.0395872 7: 0.0395872 0.0395872 0.0395872 8: 0.0395872 0.0395872 0.0395872 9: 0.0745644 0.0745644 0.0745644 10: 0.10632 0.10632 0.10632 11: 0.10632 0.10632 0.10632 12: 0.0745644 0.0745644 0.0745644 13: 0.125092 0.125092 0.125092 14: 0.116328 0.116328 0.116328 15: 0.125092 0.125092 0.125092 power_rank(): Given an NxN incidence 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 1: 0.015444 0.015444 0.015444 2: 0.011583 0.011583 0.011583 3: 0.011583 0.011583 0.011583 4: 0.015444 0.015444 0.015444 5: 0.030888 0.030888 0.030888 6: 0.030888 0.030888 0.030888 7: 0.030888 0.030888 0.030888 8: 0.030888 0.030888 0.030888 9: 0.0810811 0.0810811 0.0810811 10: 0.110039 0.110039 0.110039 11: 0.110039 0.110039 0.110039 12: 0.0810811 0.0810811 0.0810811 13: 0.146718 0.146718 0.146718 14: 0.146718 0.146718 0.146718 15: 0.146718 0.146718 0.146718 surf_rank(): Given an NxN incidence 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: 1: 0.02762 2: 0.03075 3: 0.03031 4: 0.02734 5: 0.0413 6: 0.0388 7: 0.03937 8: 0.04081 9: 0.07469 10: 0.10598 11: 0.10473 12: 0.07484 13: 0.12444 14: 0.11463 15: 0.12439 pagerank_test(): Normal end of execution. 24-Sep-2022 10:36:54