Re: Modelling complex data structures (graphs and trees for example)

2011-07-09 Thread Sean Corfield
On Sat, Jul 9, 2011 at 9:27 AM, Benny Tsai wrote: > Sorry, a bit late to the party here, but it might be worth taking a look > at Jeffrey Straszheim's c.c.graph library to see one way of modeling DAG's > and implementing various graph operations (such as topological sort and > computing strongly c

Re: Modelling complex data structures (graphs and trees for example)

2011-07-09 Thread Benny Tsai
Oops, correction: since the library already defines a struct called directed-graph, it appears that you can't define a record of the same name. So it'll have to be called something else: (defrecord graph [nodes neighbors]) (def my-graph (graph. [:a :b] {:a [:b], :b [:a]})) -- You received

Re: Modelling complex data structures (graphs and trees for example)

2011-07-09 Thread Colin Yates
Nice link - many thanks On 9 July 2011 17:27, Benny Tsai wrote: > Hi Colin, > > Sorry, a bit late to the party here, but it might be worth taking a look > at Jeffrey Straszheim's c.c.graph library to see one way of modeling DAG's > and implementing various graph operations (such as topological s

Re: Modelling complex data structures (graphs and trees for example)

2011-07-09 Thread Benny Tsai
Hi Colin, Sorry, a bit late to the party here, but it might be worth taking a look at Jeffrey Straszheim's c.c.graph library to see one way of modeling DAG's and implementing various graph operations (such as topological sort and computing strongly connected components) in Clojure: API: http:

Re: Modelling complex data structures (graphs and trees for example)

2011-07-09 Thread Colin Yates
he he :) Well, conservative might be a run-of-the-mill Java/Spring/Hibernate application with all of that fun as those are the tools which I am most familiar with. I am not going to type another long email, but it is interesting how people define "risk" and "conservative". I *do not* think "doin

Re: Modelling complex data structures (graphs and trees for example)

2011-07-09 Thread James Keats
Well if it's a project you own then you're free to do whatever you want, but if you're only an employee then I urge you to consider carefully what you're about to do, and be as conservative as you could be about it. :-) On Jul 9, 2:15 pm, Colin Yates wrote: > I did think about moving this logi

Re: Modelling complex data structures (graphs and trees for example)

2011-07-09 Thread Colin Yates
I did think about moving this logic to the database, but I am toying around with a different model - having the entire data set in memory (possibly across multiple nodes using messaging infrastructure to communicate). The reason for this is: - writes are very small but reads are very high - eac

Re: Modelling complex data structures (graphs and trees for example)

2011-07-08 Thread James Keats
On Jul 8, 8:57 pm, James Keats wrote: > On Jun 16, 3:08 pm, Colin Yates wrote: > > (newbie warning) > > > Our current solution is an OO implementation in Groovy and Java.  We > > have a (mutable) Project which has a DAG (directed acyclic graph). > > This is stored as a set of nodes and edges.  

Re: Modelling complex data structures (graphs and trees for example)

2011-07-08 Thread James Keats
On Jun 16, 3:08 pm, Colin Yates wrote: > (newbie warning) > > Our current solution is an OO implementation in Groovy and Java.  We > have a (mutable) Project which has a DAG (directed acyclic graph). > This is stored as a set of nodes and edges.  There are multiple > implementations of nodes (wh

Re: Modelling complex data structures (graphs and trees for example)

2011-06-17 Thread Andreas Liljeqvist
Surely you must have rooted my box. That is my code more or less :) To the op: Use the immutable structures if possible. Make your types as basic as possible. Use Clojure's higer order functions reduce, map etc I consider loop as a last resort. Then your solution will closely match the problem

Re: Modelling complex data structures (graphs and trees for example)

2011-06-16 Thread lambdatronic
My 2c: Regarding learning how to model a complex data structure in a functional paradigm: I can think of few resources which sum up the proper mindset you need to get into better than the canonical Clojure essay on state and identity, found here: http://clojure.org/state Regarding how t

Re: Modelling complex data structures (graphs and trees for example)

2011-06-16 Thread Andreas Liljeqvist
I would make the graph immutable. If performance is a objective it might not work though. My tip for learning it: Sit down and think about the problem. Consider your Clojure structures. 2011/6/16 Colin Yates > (newbie warning) > > Our current solution is an OO implementation in Groovy and Java.

Re: Modelling complex data structures (graphs and trees for example)

2011-06-16 Thread Raoul Duke
On Thu, Jun 16, 2011 at 7:08 AM, Colin Yates wrote: > (newbie warning) > any "domain driven design with functional programming" type resources? have you googled at all? seriously, graphs & fp are standard fare in the fp world! i'd expect there to be a zillion docs about doing it in other fp langu

Modelling complex data structures (graphs and trees for example)

2011-06-16 Thread Colin Yates
(newbie warning) Our current solution is an OO implementation in Groovy and Java. We have a (mutable) Project which has a DAG (directed acyclic graph). This is stored as a set of nodes and edges. There are multiple implementations of nodes (which may themselves be Projects). There are also mult