Dynamic criteria for melting in two dimensions