govizlora / optical-breacher

Online Cyberpunk 2077 breach protocol minigame puzzle solver using camera
https://govizlora.github.io/optical-breacher/
565 stars 31 forks source link

v1.8 - Optimize solver #23

Closed govizlora closed 3 years ago

govizlora commented 3 years ago

Fix https://github.com/govizlora/optical-breacher/issues/22

I added a pruning step at the sequence length 6.

It is based on the premise that the longest target length is 4, and we might "waste" the first 2 steps for finding a good entry point. So we can discard all the sequences that doesn't match any target when the sequence length is 6.

Also, several optimizations are added (such as using string instead of array).

When solving a 7 * 7 matrix, the speed is improved from 5000ms to 60ms