Skip to content

Google Hash Code 2021 Qualifier Extended (Optimised) - Traffic signaling - Score: 9,425,341

License

Notifications You must be signed in to change notification settings

beaudurrant/google-hash-code-2021-qualifier

Repository files navigation

Google Hash Code 2021 Qualifer

"Traffic signaling"

Problem statement

Usage

npm start

Strategy

  1. Create verticies from edges
  2. Traverse paths find the total intersections (Ti) and edge intersections (Ei) at each vertex
  3. Calculate cycle per edge at each intersection; cycle = floor(Ti / (Ti - Ei))
  • This doesn't provide the optimal solution for every case, it's a greedy algorithm that works well for all cases

Scores

  • A – An example - 2,000
  • B – By the ocean - 4,565,706
  • C – Checkmate - 1,294,235
  • D – Daily commute - 1,580,662
  • E – Etoile - 697,390
  • F – Forever jammed - 1,285,348

Total Score: 9,425,341

License (MIT)

MIT

About

Google Hash Code 2021 Qualifier Extended (Optimised) - Traffic signaling - Score: 9,425,341

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published