Follow

Translate

Monday, March 14, 2016

Warshall's Algorithm



1.  Repeat for I, J = 1, 2......, M: [Initializes P].
      If A[I, J] = 0, then : Set P[I, J]:=0;
 Else: Set P[I, J] : = 1.
[End of loop.]

2.  Repeat Steps 3 and 4 for K = 1, 2, ......., : [Updates P.]

3.  Repeat Step 4 for I = 1, 2,....,M:

4.                Repeat for J = 1, 2,......,M:
                                       Set P[I, J] : = P[I, J] v (P[I, J] ^ P[K, J]).
[End of loop].
[End of Step 3 loop]

5.Exit.
If You want to learn about the technology, computer science & engineering, web programming, freelancing, earning please click here :CSE SOLVE

Related Posts:

  • Shortest Path Algorithm (Shortest Path Algorithm) A directed graph  G with M nodes is maintained in memory by its weight matrix W. This algorithm finds a matrix Q such that Q[I,J] is the length of a shortest path from node VI tonode VJ.Infin… Read More
  • Solve Math problem By Using Linear Arrays Solve Math problem By Using Linear Arrays: 4.1  Consider the linear arrays AAA(5:50), BBB(-5:10) and CCC(18). (a) Find the number of elements in each array. (b) Suppose Base(AAA) = 300 and W = 4 words per memory cel… Read More
  • Example Using the bubble sort algorithm Using the bubble sort algorithm, Algorithm 4.4, find the number C of comparisons and the number D of interchanges which alphabetize the n = 6 letters in PEOPLE. The sequence of pairs of letters which are compared in … Read More
  • (Matrix Multiplication) MATMUL(A, B, C, M, P, N) (Matrix Multiplication) MATMUL(A, B, C, M, P, N) Le A be an M * P matrix array, and let B be a P * N matrix array. This algorithm stores the product of A and B in an M * N matix array C. 1.  Repeat Steps 2 to 4 for I… Read More
  • Warshall's Algorithm (Warshall's Algorithm) A directed graph  G with M nodes is maintained in memory by its adjacency matrix A. This algorithm finds the (Boolean) path matrix P of the graph-G 1.  Repeat for I, J = 1, 2......, M: [In… Read More

0 comments:

Post a Comment