Else , continue to do BFS
if ( level [ self . adj [ s ] [ i ] ] < 0 or level [ self . adj [ s ] [ i ] ] > level [ s ] + 1 ) : NEW_LINE INDENT level [ self . adj [ s ] [ i ] ] = level [ s ] + 1 NEW_LINE queue . append ( self . adj [ s ] [ i ] ) NEW_LINE DEDENT i += 1 NEW_LINE