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

Fixed points or 3-colorings of functions without fixed points #1

Open
chadbrewbaker opened this issue Apr 28, 2016 · 1 comment
Open

Comments

@chadbrewbaker
Copy link
Owner

Felix Dilke put in a request for fixed points of an endofunction, or a 3-coloring of an endofunction such that x and f(x) do not have the same color.

fixedPoints :: (a->a) -> [a] -> [a]

threeColoring :: (a->a) -> [a] -> [ [a],[a],[a]]
threeColoring f set
| (length $ fixedPoints f set) == 0 = []
| otherwise = -- split into connected components. 3 color cycles, greedy color tree branches

@chadbrewbaker
Copy link
Owner Author

If memory serves Munro had a few algorithms in that vein which could be nice to have features, Succinct Representations of Permutations and Functions

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

1 participant