Given a connected, undirected graph represented by an n x n Boolean adjacency matrix where matrix[i][j] = true indicates an edge, write a function that takes two vertex indices and returns the shortest distance between them measured by the minimum number of edges.
Asked in the Phone Screen stage. Use breadth-first search because every edge has equal cost. The function receives matrix, start, and end, and returns an integer distance.
def shortest_distance(matrix, start, end):