I have this matrix that hold path between vertexes.for example for 4 vertex we have the matrix like this :
0 0 1 1
1 0 1 1
0 0 0 1
0 0 0 0
That shows us we have path between (1,3) & (1,4) & (2,1) & (2,3) & (2,4) & (3,4).
The input of my problem is new path between two vertex and the output is the update of that matrix .
For example :
Input:(3,2)
Output:
1 1 1 1
1 1 1 1
1 1 1 1
0 0 0 0
I want to do it with this order : O(V^2)