called every time before a BFS so that visited array is reset to zero
def reset_visited ( ) : NEW_LINE INDENT for i in range ( n ) : NEW_LINE INDENT for j in range ( m ) : NEW_LINE INDENT visited [ i ] [ j ] = 0 NEW_LINE DEDENT DEDENT DEDENT