views:

379

answers:

2

Anybody know of an implementation of graph algorithms in Smalltalk?

I'd like something that allows you to implement an interface on your model objects or something and provides algorithms for transitive closure, transitive reduction, topological sort, etc., etc.

People end up re-implementing these widely-applicable algorithms so often, it would be great to have a generic implementation available that everybody could use.

Pointers to a similar library for other (preferably OO) languages that could be ported would also be useful I guess.

+3  A: 

I don't know if it has everything you need (and it includes a whole lot of other stuff), but the Jun library (GPL Licensed) might be a good place to start. It's shipped as part of the standard NC version of VisualWorks, not sure about the other Smalltalks. The package you'd be interested in is called Jun-Topology-Graph.

Rydier
I don't see it in the VW NC 7.6 I have installed... I checked the Public Store but then I don't know VW very well so maybe I'm not looking in the right place.
Julian
Sorry for replying so late, didn't notice the comments...Go to the parcel manager, under the Graphics directory you'll find Jun.Once loaded (it's rather large), you should be able to find the package in the class browser.
Rydier
+3  A: 

For Squeak, check out http://www.squeaksource.com/Graph.html which claims to be a graph library, as in "These classes add a collection category to represent collections tha tdo not necessarily have a sequence, but are more structured than sets".

Randal Schwartz