[Lemon-devel] Naming question again

Kovács Péter kpeter at inf.elte.hu
Wed Apr 2 19:15:23 CEST 2008


Hi,

 > The question is what to do is a 'graph' can mean either a directed or
 > an undirected graph?

That is an important question in many other cases, too (e.g. in the 
documentation and about the naming of data members, paramters etc.).
In my opinion 'graph' can mean either a directed or an undirected graph. 
It is not necessary to restrict ourselves to use 'digraph' everytime 
when it can be a directed graph.
I think, it is more misleading that an undirected graph can be used 
whenever a 'digraph' is needed according to the documentation. (E.g. 
using Bfs, Dfs, Dijkstra algorithms.)

So, for me it is not annoying to use 'graph' for both cases (in codes 
and in the doc), when it does not cause misunderstanding. For example,
   void foo(const ListGraph& graph);
   void foo(const ListDigraph& graph);

However as we have DigraphCopy, GraphCopy, and BpGraphCopy, we should 
have DigraphToEps, GraphToEps, and BpGraphToEps.

 > How to call a function setting the color of the edges/arcs?
 > edgeColor() of arcColor()?

I prefer arcColor() for DigraphToEps and edgeColor() for GraphToEps (or 
both names for both cases).

Regards,
Peter


Alpár Jüttner írta:
> Hi,
> 
> I started to port graph_to_eps.h and I came across the following
> problem.
> 
> The question is what to do is a 'graph' can mean either a directed or an
> undirected graph? For example should it be called as graphToEps() or
> digraphToEps()? There is a similar question with arc/edge. How to call a
> function setting the color of the edges/arcs? edgeColor() of arcColor()?
> 
> Personally, I would use graph and edge in these situations, but what is
> your opinion?
> 
> Another option is to use both as an alias (at least for the member
> function).
> 
> Regards,
> Alpar
> 
> 





More information about the Lemon-devel mailing list