Sat Mar 5 20:19:30 2022 floyd_test(): Python version: 3.6.9 Test floyd(). floyd_test01(): floyd() uses Floyds 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. Node-to-node one-step distance array A: [[ 0. 2. 5. inf inf inf] [inf 0. 7. 1. inf 8.] [inf inf 0. 4. inf inf] [inf inf inf 0. 3. inf] [inf inf 2. inf 0. 3.] [inf 5. inf 2. 4. 0.]] Node-to-node shortest total distance array B: [[ 0. 2. 5. 3. 6. 9.] [inf 0. 6. 1. 4. 7.] [inf 15. 0. 4. 7. 10.] [inf 11. 5. 0. 3. 6.] [inf 8. 2. 5. 0. 3.] [inf 5. 6. 2. 4. 0.]] floyd_test02(): Test floyd() on matrices of increasing order N. The work is roughly N^3. N Time (seconds) Time/N^3 1 0.000007 6.914139 2 0.000017 2.115965 4 0.000094 1.464039 8 0.000692 1.350883 16 0.005363 1.309207 32 0.042316 1.291373 64 0.172884 0.659499 128 1.355041 0.646134 256 10.928429 0.651385 512 93.933476 0.699859 1024 841.326015 0.783546 floyd_test03() floyd() starts with the adjacency matrix A of a triangulation, determines the pairwise distance matrix B. One-step distance matrix: [[ 0. 1. inf ... inf inf inf] [ 1. 0. 1. ... inf inf inf] [inf 1. 0. ... inf inf inf] ... [inf inf inf ... 0. 1. inf] [inf inf inf ... 1. 0. 1.] [inf inf inf ... inf 1. 0.]] Floyd distance matrix: [[ 0. 1. 2. ... 13.41421356 13. 14. ] [ 1. 0. 1. ... 12.41421356 12. 13. ] [ 2. 1. 0. ... 11.41421356 11. 12. ] ... [13.41421356 12.41421356 11.41421356 ... 0. 1. 2. ] [13. 12. 11. ... 1. 0. 1. ] [14. 13. 12. ... 2. 1. 0. ]] Graphics saved as "floyd_test03.png" floyd_test(): Normal end of execution. Sat Mar 5 20:35:18 2022