Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Directions/Routing Algorithm #4

Open
dgetu opened this issue Jan 30, 2021 · 0 comments
Open

Directions/Routing Algorithm #4

dgetu opened this issue Jan 30, 2021 · 0 comments

Comments

@dgetu
Copy link
Owner

dgetu commented Jan 30, 2021

Utilize the Google Maps Directions API to determine an optimal path.
First pass at the pathfinding algorithm:

  1. Define a cost algorithm for a path
  • This includes the length of the path and the concentration of crime along the path.
  • Define the crime density function [(lat, long) -> intensity] to be the sum of Gaussian curves centered on each crime datapoint
  1. Generate a polyline which approximates a safe path
  • Limit pathfinding algorithm to the circle which includes the starting and ending points on the diameter. This limits the path to pi times as long as the direct path (approximately)
  1. Determine the cost of the polyline
  • Weighted sum of the length of the polyline and line integral of the crime density function
  • Weights of the sum are partially set in advance for good performance, but can be adjusted based on the user's tolerance for risk of crime
  1. Minimize the cost
  • Hill climbing/gradient descent algorithm
  1. Pass the optimal polyline in encoded polyline form to the Directions API
  2. Test the result for sufficiently low cost
  3. Pass the result to the client
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant