Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CALC_LEN_PATH(G, A, B, LEN){
- G2 = G // copy
- for t=1 to n{
- G3 = ZeroMatrix
- for k = 1 to n{
- for i = 1 to n{
- for j = 1 to n{
- if(G2[i][k]>0 and G[k][j]>0){
- G3 += G2[i][k]
- }
- }
- }
- }
- G2 = G3 //copy
- }
- return G2
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement