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

FlagsConverter tweaks & code cleanup #122

Merged
merged 6 commits into from
May 13, 2024

Conversation

ahmetsait
Copy link
Collaborator

Changes of insterest:

  • Tweak FlagsConverter so it produces smaller string representations of the flag
    Finding the smallest flag combination that completely encompasses a given value is actually NP-hard. See: https://en.wikipedia.org/wiki/Set_cover_problem
    What we use here is a greedy O(N²) algorithm but the biggest integer is 64 bits so the worst case doesn't seem that bad.
  • Run code cleanup

@ahmetsait ahmetsait marked this pull request as draft May 12, 2024 16:27
ahmetsait added 2 commits May 12, 2024 19:32
…of the flag

Finding the smallest flag combination that completely encompasses a given value is actually NP-hard. See: https://en.wikipedia.org/wiki/Set_cover_problem
What we use here is a greedy O(N²) algorithm but the biggest integer is 64 bits so the worst case doesn't seem that bad.
@ahmetsait ahmetsait marked this pull request as ready for review May 12, 2024 16:45
@desjarlais desjarlais merged commit 9b05b78 into desjarlais:master May 13, 2024
2 checks passed
@desjarlais desjarlais self-assigned this May 13, 2024
@ahmetsait ahmetsait deleted the flags-editor branch May 13, 2024 14:35
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.

2 participants