Tue May 20 21:37:26 2025 floyd_test(): python version: 3.10.12 numpy version: 1.26.4 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.675720 2 0.000016 1.996756 4 0.000088 1.378357 8 0.000646 1.261476 16 0.005020 1.225504 32 0.040375 1.232162 64 0.151665 0.578557 128 1.178113 0.561768 256 9.446085 0.563031 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. Tue May 20 21:37:37 2025