Le 19 déc. 2015 à 16:14, Peter Uhnák a écrit :
I'm curious about the design decisions behind Moose Graph Algorithms.
Basically each algorithm (or at least many of them) has their own
separate class for edges and/or vertices.
This in theory makes the code more descriptive, however it also makes
integration between various algorithms much harder, because now if I
want to run two different algorithms on a single graph I have to
convert them to the appropriate format.
Yes, I got the same problem.
Wouldn't it make more sense to have the necessary behavior pluggable
and have only a single representation of a graph?
I'm sure there some other benefits to the current approach, however I
do not see them.
For some algorithms, it is convenient to have specific nodes to hold data related to nodes
(e.g. weight) or temporary data needed for the algorithm itself.
So all in all I would like to have a perhaps more
functional (as in
function) approach, as that more closely matches the mathematics
behind the algorithm(s).
Indeed, there are other ways to do that and it could be a good idea to test another
What is bad with specific nodes and edges is that it does not scale if you have big
graphs. It would be good to reuse the graph of your domain.
Maybe you can start to implement a new version of the algorithms you need that way. Then,
we can evaluate pros and cons of both approaches.