Python Forum
Calculate the fewest zip codes, for the largest coverage
Thread Rating:
  • 1 Vote(s) - 4 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Calculate the fewest zip codes, for the largest coverage
#1
This is a problem I'm in the middle of solving, and because I don't want to spend forever on it, I'll probably brute force a solution.

Suppose there's a third party website which displays information within a radius (max 25 miles) of a given zip code.  Suppose you want to scrape that website, for all the available info for the entire US.  You know, so you can analyze it, or whatever.

The site in question isn't the fastest in the world, so just blasting it with thousands of zip codes will take... too long to run.

So the problem is then, how do you choose zip codes strategically to cover the entire US, without having too much overlap between the radii between those zip codes?  This seems like basic geometry to me, but I'm bad at math, so...

What I'm working on now is basically pick a zipcode, then in each of the cardinal directions, the next zip code is as close to 10 miles away without going over.  So there's a 15 mile overlap (in each direction, for each zip code), but there's no uncovered territory.  So I'll need to dedupe the results from the external system.  Is there a better way to do this, such that there's no uncovered territory and ALSO less zips involved?

For reference, here's five zip codes, each with a 25(ish) mile radius, near Seattle (you can see that there will be A LOT of requests this way...).

Attached Files

Thumbnail(s)
   
Reply


Messages In This Thread
Calculate the fewest zip codes, for the largest coverage - by nilamo - Mar-07-2017, 05:57 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
Question Help to find the largest int number in a file directory SalzmannNicholas 1 1,664 Jan-13-2022, 05:22 PM
Last Post: ndc85430
  find 2 largest equal numbers Frankduc 13 3,666 Jan-11-2022, 07:10 PM
Last Post: Frankduc
  Largest product in a grid (projecteuler problem11) tragical 1 2,317 Sep-14-2020, 01:03 PM
Last Post: Gribouillis
  Extract the largest value from a group without replacement (beginner) preliator 1 2,108 Aug-12-2020, 01:56 PM
Last Post: DPaul
  frequency of largest number group anshumanmuj 5 3,037 Jun-22-2020, 04:51 PM
Last Post: perfringo
  Sort by the largest number of the same results (frequency) inlovewiththedj 3 2,239 Apr-01-2020, 07:29 AM
Last Post: DPaul
Lightbulb how to get improve coverage while using coverage.py sami23 0 1,501 Jan-22-2020, 10:53 AM
Last Post: sami23
  Find the second largest number DarkCraftPlayz 8 11,407 May-29-2019, 02:46 AM
Last Post: heiner55
  Looking for good doc on Scraping coverage algorithms Larz60+ 0 1,930 Jan-05-2019, 03:22 PM
Last Post: Larz60+
  How to use python to do "for each 365 data, print the largest 18 value? ctliaf 1 2,718 Apr-28-2018, 08:14 PM
Last Post: snippsat

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020