[Lemon-user] Graphs need first and next?
Kovács Péter
kpeter at inf.elte.hu
Sat Aug 21 10:24:39 CEST 2010
Dear Ben,
This aspect of the graph concepts is a bit confused. Each graph class
provides first and next functions for nodes and arcs/edges (a low level
interface). However, they do not appear in the public documentation,
probably to orient the users to use the higher level iterator
interfaces. Almost all generic tools rely only on the iterators, but
there are some exceptions, e.g. DFS. Therefore, it is important to
require these functons in the concepts, as well. Actually, I dislike
this "hidden" aspect of the concepts, I would prefer to correctly
display these functions in the documentation.
If you would like to develop a new graph type, then I suggest you to
follow the construction of the LEMON graph sturctures. E.g. in case of
ListDigraph, there is a base class ListDigraphBase, which implements
only the base interface (i.e. first, next functions) and neither
iterator nor map classes. ListDigraph is just a typedef for
DigraphExtender<ListDigraphBase>, where DigraphExtender is a special
class that extends the interface of the template parameter to fully
conform to the Digraph concept.
I suggest you to have a look at list_graph.h and bits/graph_extender.h
for better understanding.
Best regards,
Peter
> Hello,
>
> I have been implementing a specialized graph structure and have
> implemented the interface as described in the documentation:
> http://lemon.cs.elte.hu/pub/doc/latest/a00099.html
> There first and next are not listed.
>
> However lemon/dfs.h makes use of them and lemon/concepts/digraph.h
> lists prototypes for those functions. Am I supposed to implement them or
> am I missing something?
>
> Regards,
> Ben Strasser
> _______________________________________________
> Lemon-user mailing list
> Lemon-user at lemon.cs.elte.hu
> http://lemon.cs.elte.hu/mailman/listinfo/lemon-user
More information about the Lemon-user
mailing list