
Hello Haskellers, I would like to implement a graph based algorithm, the sum-product algorithm, in Haskell. I have looked at the FGL package, but I am not sure whether this is really what I need. For example, I need to know whether I am at a leaf (assuming the first version I implement is the "original" algorithm which works for trees). I would also need to store numerical values as well as functions at nodes and edges. The FGL provides for "labels" at nodes and edges, but these appear to have to be instances of classes such as Eq or Ord, which does not work well for functions. I could of course store node values and edge functions externally, e.g. in a Map. All this seems a bit awkward, but I may still just not have enough experience in Haskell. Can anyone give me a hint, or is there maybe even already a factor graph implementation out there which I have missed? Thanks, Christian

On Jun 13, 2011, at 8:38 AM, . wrote:
I could of course store node values and edge functions externally, e.g. in a Map. All this seems a bit awkward, but I may still just not have enough experience in Haskell.
In my experience using fgl, I used maps to store values externally as you have described. It didn't seem inconvenient at all.
participants (2)
-
.
-
David Place