Haskell

The meeting place for professional Haskell programmers
You are not logged in. In order to participate in Special Interest Groups, you should log in now .

New graph library / changes to FGL (Discussion)

Created by Thomas Imre Bereknyei on November 6, 2010 10:27:12 PM.
Status: Open

Messages

By Thomas Imre Bereknyei @ November 6, 2010 10:28:12 PM
Please post any ideas for changes/addition to FGL or anything you'd look for in a new graph library.
By Jason Knight @ November 19, 2010 02:08:26 AM
I've continually wanted a "non-destructive" map and fold operation for graphs. As an example of what I mean, let's say I want to create a list of the degrees of each node. What makes sense to me is the following:

add c xs = deg' c : xs
ufold add [] myGraph

But unfortunately, this will only count edges once, whereas I want them counted once for each node they are connected to, rather than just the first one that is matched off in the ufold. 

Am I missing something here or has this confused other people too?
By Ivan Lazar Miljenovic @ November 24, 2010 03:53:16 AM
Yeah, Thomas and I have discussed this as well.

The danger of such a non-decomposing mapping is that people might be tempted to try to create the graph from the resulting Contexts, which won't work.

Login with