Improving Wi-Fi based localization using external constraints