What is your favourite graph library?

Hello! I really like graphs. People seem to like thinking in terms of dots and arrows, and graph theory provides a formalization for this. (Homogeneous binary) relations, finite state automata, networks and categories are sorts of graphs too. But unfortunately it is not possible to represent a graph as an algebraic type. For example, a list is a fixed point of a maybe tuple, and every usual linear container _(an array, a vector, a sequence…)_ is isomorphous to a list, so we have an easy time prototyping and specifying the behaviour of any such thing. With graphs, we have a hard time! The most popular library for graphs in Haskell is `fgl`. Unfortunately, it is really easy to get weird behaviour with it, because folds tear away the limbs from contexts so that your observation of said contexts depends on the order of folding. I have been poking at it, trying to make graphs resemble a comonad… but of course you can have an empty graph, and a comonad cannot be empty. There is also `alga` — it seemed promising, but now it is deprecated for some reason… The usual `containers` also provide something they call a graph, but it does not offer much in terms of instances and algorithms — a graph is merely a type alias to an array. So, is there any cool library that I missed? Or some promising research? Do you know of any packages that use graphs heavily and in interesting ways? Are you curious to see progress in this area?

February 24, 2021 10:19 PM, "Ignat Insarov"
I have been trying to make graphs resemble a comonad… but of course you can have an empty graph, and a comonad cannot be empty.
You may be interested in the `Extend` class from `semigroupoids`, which is "`Comonad` without `extract`": https://hackage.haskell.org/package/semigroupoids-5.3.5/docs/Data-Functor-Ex...
So, is there any cool library that I missed? Or some promising research? Do you know of any packages that use graphs heavily and in interesting ways? Are you curious to see progress in this area?
Not strictly a package about graph representation, but I always liked how easily functions from search-algorithms plugged into my projects: https://hackage.haskell.org/package/search-algorithms-0.3.1/docs/Algorithm-S... There's also the "Algebraic Graphs with Class" functional pearl, which you might already be aware of: https://eprint.ncl.ac.uk/file_store/production/239461/EF82F5FE-66E3-4F64-A1A... HTH, -- Jack

On Wed, 24 Feb 2021, Ignat Insarov wrote:
So, is there any cool library that I missed? Or some promising research? Do you know of any packages that use graphs heavily and in interesting ways? Are you curious to see progress in this area?
I wrote this package: http://hackage.haskell.org/package/comfort-graph The goal was to have more descriptive node and edge identifiers than Int and the ability to mix directed and undirected edges.

I wrote Hode[1], a library for a generalization of graphs. Relatiionships in Hode can have any number of members, and those members can themselves be relationships. Relationships are "templated"; relationship templates are the natural generalization of edge labels. Hode includes a TUI and a query language resembling natural language. I intended it to be for managing a personal knowledge base. Hode is more expressive than anything I know about, but (so far) harder to use. Encoding things is easy, and search is as easy as I think can be hoped for -- but deciding *how* to encode things turns out to be really hard. So much so that I've ended up using Semantic Synchrony[2] and org-roam[3] instead. [1] https://github.com/JeffreyBenjaminBrown/hode [2] https://github.com/synchrony/smsn [3] https://github.com/org-roam/org-roam On Wed, Feb 24, 2021 at 9:48 AM Henning Thielemann < lemming@henning-thielemann.de> wrote:
On Wed, 24 Feb 2021, Ignat Insarov wrote:
So, is there any cool library that I missed? Or some promising research? Do you know of any packages that use graphs heavily and in interesting ways? Are you curious to see progress in this area?
I wrote this package: http://hackage.haskell.org/package/comfort-graph
The goal was to have more descriptive node and edge identifiers than Int and the ability to mix directed and undirected edges._______________________________________________ Haskell-Cafe mailing list To (un)subscribe, modify options or view archives go to: http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe Only members subscribed via the mailman list are allowed to post.
-- Jeff Brown | Jeffrey Benjamin Brown LinkedIn https://www.linkedin.com/in/jeffreybenjaminbrown | Github https://github.com/jeffreybenjaminbrown | Twitter https://twitter.com/carelogic | Facebook https://www.facebook.com/mejeff.younotjeff | very old Website https://msu.edu/~brown202/

Am 24.02.21 um 13:19 schrieb Ignat Insarov:
I really like graphs.
I hate them. Whenever I encounter a graph related problem I /want/ to reach for an established library, same as you. And invariably I end up re-inventing the wheel because I find that for my particular problem the data representation in any of the general purpose graph libraries are not suitable. Cheers Ben
participants (6)
-
Ben Franksen
-
Henning Thielemann
-
Ignat Insarov
-
jack@jackkelly.name
-
Jaro Reinders
-
Jeffrey Brown