2010/1/16 Simon Brooke <still...@googlemail.com>:
> general case of a cyclic directed graph. Surely there must be some
> clean idiomatic way of creating a cyclic graph?

I experimented with something very similar when I first encountered Clojure:
http://clojure.googlegroups.com/web/funmud.clj
And ended up representing the rooms as a hash-map indexed by room
number, with the room containing exits which are indices to other
rooms. This has some weaknesses but for my purposes it did the trick
and kept things very simple.

If you want to use a cyclic graph then you do need mutation to link it
up. I suggest you take a look at the internals of dgraph which
Constantine just released as it contains an excellent graph
implementation:
http://github.com/gcv/dgraph/blob/master/src/dgraph.clj


Regards,
Tim.
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to