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

v1.8 - Optimize solver #23

Merged
merged 6 commits into from
Jan 23, 2021
Merged

v1.8 - Optimize solver #23

merged 6 commits into from
Jan 23, 2021

Conversation

govizlora
Copy link
Owner

Fix #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

@govizlora govizlora merged commit 78c45f9 into main Jan 23, 2021
@govizlora govizlora deleted the algo branch January 23, 2021 20:29
@govizlora govizlora changed the title v1.8: Optimize solver v1.8 - Optimize solver Jan 23, 2021
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

Successfully merging this pull request may close these issues.

Infinite loop when solving this problem
1 participant