The function graph_tool.spectral.adjacency<http://graph-tool.skewed.de/static/doc/spectral.html?highlight=adjacency#graph_tool.spectral.adjacency&gt; returns transpose of the adjacency matrix of a directed graph that is commonly used. Is this intentional? A misinterpretation of column-major versus row-major on my part?

Compare a few standard examples:

import graph_tool.all as gt

g = gt.Graph()
A.todense()
[e for e in g.edges()]
## -- End pasted text --
Out[2]: [<Edge object with source '0' and target '1' at 0x11fb10d60>]

A.todense()
Out[3]:
matrix([[ 0., 0.],
[ 1., 0.]])

A in this case is most commonly defined as [[0, 1], [0, 0]]

attachment.html (1.91 KB)

It is true that most software and some websites use the more intuitive
definition that you were expecting. However a large part of the
theoretical literature uses the transposed definition, since it can be
more convenient mathematically. See for instance Mark Newman's book.

In any case, this an unimportant issue. A matrix transpose can be
obtained trivially in numpy.

Best,
Tiago

It is true that most software and some websites use the more intuitive definition that you were expecting. However a large part of the theoretical literature uses the transposed definition, since it can be more convenient mathematically. See for instance Mark Newman's book.

I know — I use Godsil and Royle, who use the “correct” untransposed version in Algebraic Graph Theory ;o)

Because you cite the Wikipedia definition in your excellent documentation, I’d suggest documenting the convention you use explicitly, which is the transpose of Wiki’s (current) definition.

attachment.html (1001 Bytes)

That makes sense. I also noticed that the documentation of the other
spectral functions were inconsistent with this definition. I have fixed
it now:

Best,
Tiago