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

Accelerates epsilon closures #148

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

sfstewman
Copy link
Collaborator

This PR has two techniques to accelerate generating epsilon closures for states and sets of states:

  1. Uses Tarjan's strongly connected components to pre-generate epsilon closures for individual states
  2. Uses pre-generated state epsilon closures to build epsilon closures for sets of states

I've mostly filed this PR because @katef asked me to. I'm not sure it's worth merging in its current state. It shows some performance regression for graphs with few epsilon transitions, and it's not clear what features of the graph (number of epsilon transitions, density of epsilon transitions, etc.) would make this a performance win. We do know that it makes unanchored word determinization a lot faster, and it slightly slows down anchored word determinization.

A few notes:

  1. The first step isn't always a performance win. For graphs that have few epsilon closures, the SCC algorithm adds an extra iteration through the states. However, for epsilon-heavy graphs, this can dramatically reduce the work of generating epsilon closures.
  2. The second step should always improve performance, and could be combined with memoizing the epsilon closure of a state.

- The re program can output nfa graphs with a state index or connected component label
- The fsm program can output graphs with a connected component label
Uses a unique unsigned long instead of a hash set.
@sfstewman sfstewman requested a review from katef April 30, 2019 03:17
@katef katef changed the base branch from master to main June 14, 2020 00:49
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.

None yet

1 participant