Source file:
#include #define M 100 # define n 7 // Defined to 7 is convenient, so you can use A [6] to express the sixth point
INT min (int A, int b) {INT C; if (a> b) c = b; ELSE C = a; Return C;
Void main () {INT I, J, K; // Initial (int N]; n [1] = 1; // equal to 1 means node 1 in set N; N [i] = 1 denotes I point in set N // INITIAL (L); int L [N] [n] = {// Node distance matrix {0}, {0, 0, 2, 5, 1, m, m}, // Node 1 {0, 2, 0, 3, 2, M, M}, {0, 5, 3, 0, 3, 1, 5}, {0, 1, 2, 3, 0, 1, 4 }, // node 4 {0, M, M, 1, 1, 0, 2}, {0, M, M, 5, 4, 2, 0}}; // Node distance matrix input End // Initial [ S] INT S [N] [N]; for (i = 2; i