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
LabelledAdjacencyMap? #109
Comments
Hi @o1lo01ol1o! I think the implementation will be pretty similar to Map a (Set a) the labelled version will use Map a (Map a e) as the underlying data structure (with edge labels of type If you don't want to use dioids for labelling, then here is an alternative: Map a (Set (a, e)) Now instead of collapsing parallel edges using one of dioid's operations, you explicitly store each edge separately. The former seems a bit more general, since one can always pick Would you like to give it a try? |
Hi, thanks for the reply. I ended up with something similar to the latter in the interm. However, I I'll try to re-tailor my implementation and create a PR. |
Thanks! By the way, I think I was wrong in my previous comment when I said that one of the encodings is more general than the other -- they are actually equivalent in terms of generality. But one may be easier/faster to work with than the other. |
See #113 |
After merging #113, we still need to do the following:
|
I think we can close this issue. See the module here: https://hackage.haskell.org/package/algebraic-graphs/docs/Algebra-Graph-Labelled-AdjacencyMap.html |
I have a case where I need to model a graph (of labeled edges) via an adjacency map representation (I need, among other things, to sort the graphs topologically and compute the cycles via
scc
). It looks like theDiode (Set e)
would take care of the labeling issue (my labels function only as edge identifiers) but I'm not sure what the best representation would be for the adjacency map itself given that I also need a King-Launchbury representation if I'm to avoid writing the sorts myself. Could anyone advise?The text was updated successfully, but these errors were encountered: