I am looking to develop a recommendation engine for local stores to users. There are approximately 1 million stores in the database and around 1 million users. The 1Mx1M matrix for a user-based collaborative filtering can be prohibitive to calculate. I'm trying to come up with shortcuts. The main one that I can envision is the fact that a user will only typically travel approximately 20 miles to visit a store, so comparing a New York user to one in California is typically a wasted computation. However, this would similarly require a distance matrix between users.
Are there any existing solutions for this? Any tutorials or github examples would be appreciated. I could only find examples using distance calculations between all examples.
Note: if possible I would like to use Python.