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

Valmari's Algorithm for Minimizing Partial DFAs #161

Open
eliotwrobson opened this issue Jul 18, 2023 · 10 comments
Open

Valmari's Algorithm for Minimizing Partial DFAs #161

eliotwrobson opened this issue Jul 18, 2023 · 10 comments

Comments

@eliotwrobson
Copy link
Collaborator

eliotwrobson commented Jul 18, 2023

https://arxiv.org/abs/0802.2826

This paper is a more abstract description of Valmari's algorithm for minimizing partial DFAs. It should be easier to read and implement than the paper with the C++ code. Once we get a first iteration of partial DFA support, it would be awesome if we could add this algorithm as the default for minimizing partial DFAs (should be much faster over large alphabets).

Originally posted by @eliotwrobson in #126 (comment)

Note this should only be done after #159.

EDIT: We have closed 159 as not being planned, so we can go ahead with this issue if anyone wants to attempt it. Should give substantial performance improvements for minimizing partial DFAs.

@sracha4355
Copy link

Hey I could give it a shot. Are you guys under any time constraint to get this done? Asking because I will be busy with school.

@eliotwrobson
Copy link
Collaborator Author

@sracha4355 that would be awesome! No time constraint, and feel free to put up a draft PR if you ever want any feedback.

@sracha4355
Copy link

Any tips on understanding the codebase, I am not an active user. I was just looking for cool projects to contribute to!

@eliotwrobson
Copy link
Collaborator Author

eliotwrobson commented Oct 27, 2023

This is actually a fairly good task for someone who is not familiar, as it only involves implementing a single algorithm. The main thing is to take a look at the _minify function in the DFA class (see here), as the new algorithm will be replacing the function there. The other main thing is to understand is how DFAs are represented in the library, and for that I think it should be sufficient to take a look at some of the examples in the documentation: https://github.com/caleb531/automata/blob/main/docs/fa/examples.md

Basically, the transitions are represented with a nested dictionary, and that is the main structure this algorithm will be operating on.

@EduardoGoulart1
Copy link
Contributor

EduardoGoulart1 commented Dec 11, 2023

@sracha4355 are you still looking into it? Otherwise I could give it a try in the next days

@eliotwrobson
Copy link
Collaborator Author

@EduardoGoulart1 this issue has been open for a while, so if you have the time I'd say go ahead and start working!

@sracha4355
Copy link

@EduardoGoulart1 Hey, I was planning on tackling this issue once school ends, which is in 2 weeks. But if you would like to work on this, go ahead! If you want to collaborate let me know.

@EduardoGoulart1
Copy link
Contributor

@EduardoGoulart1 Hey, I was planning on tackling this issue once school ends, which is in 2 weeks. But if you would like to work on this, go ahead! If you want to collaborate let me know.

@sracha4355 Could you please update us here when you start to work on it? I can wait until the turn of the year. But it would be good to have it merged rather soonish

@sracha4355
Copy link

@EduardoGoulart1 you can go ahead and work on it!

@eliotwrobson
Copy link
Collaborator Author

Don't worry too much about doing overlapping work. I think this algorithm is pretty tricky to implement correctly and might even take a few attempts to get right.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants