Question : Calculate nearest store for a database

I have a database of 800 stores and a consumer database of 800,000 customers. I want to allocate a nearest store to the customer database, along with the distance in miles, to each of consumer record. Anyone know of a solution to do this at all?

Many Thanks!

Answer : Calculate nearest store for a database

you could create a graph with a vertex as a zipcode, and an edge representing the distance between them.
when a user enters a zip code, check all that vertex's edges and return the closest ones
Random Solutions  
 
programming4us programming4us