Learning BFS 1
Given N vertices and an Adjacency Matrix of an Undirected Graph.
Find the minimum distance from Source(S) to Destination(D).
If it is not Reachable display -1.
First Line contains single integer t containing number of test cases that follow.
First Line of each test case consists of a single integer N denoting the number of vertices.
Second Line contains two integers Source(S) and Destination(D).
Next N lines each containing N elements describe the Adjacency Matrix.
T lines , one line for each test case containing a single Integer that gives minimum distance required to reach D from S.
If it is unreachable output -1.
0 < N < 25
0 <= S,D < N
0 1 0
1 0 1
0 1 0
PS: Apply BFS :P
Problem Setter : Shikhar Sharad
Problem Tester : Arjun Singh Bhatia