17 May 2009 11:44:06.473 AM FLOYD_PRB FORTRAN90 version Test the routines in the FLOYD library. TEST01 I4MAT_FLOYO uses Floyd's algorithm to find the shortest distance between all pairs of nodes in a directed graph, starting from the initial array of direct node-to-node distances. In the initial direct distance array, if A(I,J) = -1, this indicates there is NO directed link from node I to node J. In that case, the value of of A(I,J) is essentially "infinity". Initial direct distance array: Col 1 2 3 4 5 6 Row 1 0 2 5 -1 -1 -1 2 -1 0 7 1 -1 8 3 -1 -1 0 4 -1 -1 4 -1 -1 -1 0 3 -1 5 -1 -1 2 -1 0 3 6 -1 5 -1 2 4 0 In the final shortest distance array, if A(I,J) = -1, this indicates there is NO directed path from node I to node J. Final shortest distance array: Col 1 2 3 4 5 6 Row 1 0 2 5 3 6 9 2 -1 0 6 1 4 7 3 -1 15 0 4 7 10 4 -1 11 5 0 3 6 5 -1 8 2 5 0 3 6 -1 5 6 2 4 0 TEST02 R8MAT_FLOYO uses Floyd's algorithm to find the shortest distance between all pairs of nodes in a directed graph, starting from the initial array of direct node-to-node distances. In the initial direct distance array, if A(I,J) = -1, this indicates there is NO directed link from node I to node J. In that case, the value of of A(I,J) is essentially "infinity". Initial direct distance array: Col 1 2 3 4 5 Row 1 0. 2. 5. -1. -1. 2 -1. 0. 7. 1. -1. 3 -1. -1. 0. 4. -1. 4 -1. -1. -1. 0. 3. 5 -1. -1. 2. -1. 0. 6 -1. 5. -1. 2. 4. Col 6 Row 1 -1. 2 8. 3 -1. 4 -1. 5 3. 6 0. In the final shortest distance array, if A(I,J) = -1, this indicates there is NO directed path from node I to node J. Final shortest distance array: Col 1 2 3 4 5 Row 1 0. 2. 5. 3. 6. 2 -1. 0. 6. 1. 4. 3 -1. 15. 0. 4. 7. 4 -1. 11. 5. 0. 3. 5 -1. 8. 2. 5. 0. 6 -1. 5. 6. 2. 4. Col 6 Row 1 9. 2 7. 3 10. 4 6. 5 3. 6 0. FLOYD_TEST03 Test I4MAT_FLOYD on the MOD(I,J) matrix. The work is roughly N^3. N Time (seconds) Time/N^3 1 0.700000E-05 7.00000 2 0.400000E-05 0.500000 4 0.900000E-05 0.140625 8 0.330000E-04 0.644531E-01 16 0.207000E-03 0.505371E-01 32 0.143700E-02 0.438538E-01 64 0.108580E-01 0.414200E-01 128 0.830130E-01 0.395837E-01 256 0.647303 0.385823E-01 512 5.11811 0.381329E-01 1024 40.4454 0.376677E-01 FLOYD_PRB Normal end of execution. 17 May 2009 11:44:53.104 AM