in Mathematica please Only detailed, neat and clear solutions are accepted Linea
ID: 3886391 • Letter: I
Question
in Mathematica please
Explanation / Answer
•Now A[i][j] = cost of edge from vi to vj.
–If no edge, either set cost to Infinity or add Boolean attribute to indicate no edge.
•New multiplication operation
–row[i]@col[j] = min { row[i][1]+col[1][j],
row[i][2]+col[2][j],…
row[i][n] +col[n][j] }
•Now A^2 contains minimum cost path of length 2 between any 2 vertices.
•A^n has complexity O(n^4). Not good.
•If add A[i][i]= 0, then A^k records minimum cost path of length = k. (how to change to allow all paths <= k)
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.