Skip to content

Optimize Subset Construction using hash#6

Open
AnicoderAndy wants to merge 1 commit into
dejavudwh:masterfrom
AnicoderAndy:master
Open

Optimize Subset Construction using hash#6
AnicoderAndy wants to merge 1 commit into
dejavudwh:masterfrom
AnicoderAndy:master

Conversation

@AnicoderAndy

@AnicoderAndy AnicoderAndy commented Oct 12, 2025

Copy link
Copy Markdown

In the original implementation, the function convert_completed in dfa/construction.py traverses the whole dfa_list, which leads to a time complexity of $O(nm)$ in the worst case, where $n$ is the size of nfa_closure and $m$ is the size of dfa_list. By introducing hash, time complexity of this procedure decreases to $O(n)$. This may help improve efficiency when inputs are complicated.

@AnicoderAndy AnicoderAndy changed the title Optimize Subset Construction using hash. Optimize Subset Construction using hash Oct 12, 2025
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.

1 participant