WebDrake / Dgraph

Graph library written in D.
GNU General Public License v3.0
45 stars 6 forks source link

Correct use of 'tail' and 'head' vertex terminology #10

Closed WebDrake closed 8 years ago

WebDrake commented 8 years ago

The previous use of 'tail' and 'head' in dgraph was in opposition to the standard usage in graph theory: 'tail' means the vertex an edge leads from, whereas 'head' means the vertex an edge leads to.

This patch consequently inverts the use of these terms. This should not affect downstream use of the code; public methods are unaltered, except in terms of their parameter names, which should not impact usage.

As a by-product, the naming conventions for the reworked private variables have been changed _fromThis toThis_ to reflect concerns that, at least in principle, names with leading underscores may be reserved.

Reference for the head/tail change includes Wikipedia: https://en.wikipedia.org/wiki/Graph_arc#Basic_terminology

... and the igraph documentation of its edges' 'from' and 'to' parameters: http://igraph.org/c/doc/igraph-Basic.html#igraph_edge

Fixes WebDrake/Dgraph#8.

WebDrake commented 8 years ago

@peter-thm FYI. Does this fix things up from your point of view?

peter-thm commented 8 years ago

@WebDrake Yes, looks good.