News for hackers. Stuff that matters.

Ask HN: Figure out the routes of LA Street Cleaners from 500K parking tickets?

HN - we're looking for some help. We have 500K Street Cleaning tickets from LA. Each ticket has the address of where the ticket was issued, and the date/time of when the ticket was issued.

From the time sequence of these tickets, we'd like to plot on a map the routes that the Street Cleaning Vehicles drive with the approximate start and stop times.

Complications: 1) At any given time, there could be multiple street cleaning vehicles out there. 2) Street Cleaning vehicles follow both daily/weekly/bi-weekly/monthly schedules 3) In general, the tickets are issued at roughly the same time that the street cleaning vehicle passes.... but sometimes it can be 10-15 minutes beforehand.

Okay, that's our problem... give us your best suggested solutions.

Thanks!

( 9 comments | 6 points | on HN )
Re:Ask HN: Figure out the routes of LA Street Cleaners from ... by shortoncash on Wednesday April 15, 2015 @09:31PM (#9385392)
You should create geographic bins and sort your tickets into them. Then for each bin, you should identify the number of peaks in the distribution of ticket timestamps associated with a bin. Operating under the assumption that the distribution of timestamps is the sum of multiple distributions (a convolution) each with a well defined mean, each peak represents the mean time when -a- vehicle arrives at your designated geographic bin to assign a ticket.

Now, with all your peaks sorted out for each bin, you want to construct a graph from bin to bin where your graph is constructed where an adjacent node in the graph is added if the numerical distance between the two peaks is the smallest of all choices. You should iteratively repeat the process until all the relevant bins are connected

Then brute force the permutations of arrangements of peaks and you should get a rough approximation of the path of the person issuing tickets.

Re:Ask HN: Figure out the routes of LA Street Cleaners from ... by davidhegarty on Thursday April 16, 2015 @09:03PM (#9391725)
@shortoncash - I like that approach! If you live up to your username, do you've any interest in doing it as a side project?
Re:Ask HN: Figure out the routes of LA Street Cleaners from ... by avitalp on Friday April 17, 2015 @12:37AM (#9392286)
@shortoncash: I like this solution a lot!

@David, are you able to put up a small test batch of the data on GitHub?

Re:Ask HN: Figure out the routes of LA Street Cleaners from ... by davidhegarty on Friday April 17, 2015 @12:16PM (#9395295)
Great. We have a blog post up: http://blog.fixed.com/post/116649853902/a-problem-we-need-he...

... I'll setup a GitHub later today.

Re:Ask HN: Figure out the routes of LA Street Cleaners from ... by davidhegarty on Friday April 17, 2015 @01:24PM (#9395781)
Re:Ask HN: Figure out the routes of LA Street Cleaners from ... by shortoncash on Thursday April 16, 2015 @10:26PM (#9391962)
I'm booked through August, unfortunately. It's an interesting problem, though.
Re:Ask HN: Figure out the routes of LA Street Cleaners from ... by kohanz on Wednesday April 15, 2015 @04:50PM (#9384005)
Be-friend someone who works for the city? I'm dead serious. I mean, you could solve this challenging technical problem only to have the schedule changed from underneath you without any notice.
Re:Ask HN: Figure out the routes of LA Street Cleaners from ... by sjg007 on Wednesday April 15, 2015 @05:32PM (#9384319)
When I lived LA, they would ticket 15mins after the start time. Also in LA there is a whole entire Parking Enforcement division. You might find multiple tickets clustered around the same time. Typically that means 1 officer working there way up the street if the address is similar. Also I think they can ticket at anytime during street cleaning even if the cleaner has passed thru.
Re:Ask HN: Figure out the routes of LA Street Cleaners from ... by benologist on Wednesday April 15, 2015 @04:55PM (#9384047)
Something like a* pathfinding might be useful, commonly used in games to plot courses between points on a grid - there may be something similar for street maps.

http://qiao.github.io/PathFinding.js/visual/