diff --git a/Task02/SequentialAlgoFloyd.cs b/Task02/SequentialAlgoFloyd.cs new file mode 100644 index 0000000..34087ce --- /dev/null +++ b/Task02/SequentialAlgoFloyd.cs @@ -0,0 +1,27 @@ +using System; + +namespace Task02 +{ + public class SequentialAlgoFloyd + { + public static int[,] Execute() + { + int n = GeneralResources.n; + int[,] dist = new int[n, n]; + Array.Copy(GeneralResources.graphMatrix, dist, n * n); + + for (int k = 0; k < n; k++) + { + for (int i = 0; i < n; i++) + { + for (int j = 0; j < n; j++) + { + if (dist[i, j] > dist[i, k] + dist[k, j]) + dist[i, j] = dist[i, k] + dist[k, j]; + } + } + } + return dist; + } + } +}