torch-ppr icon indicating copy to clipboard operation
torch-ppr copied to clipboard

Why symmetrize the adj matrix?

Open Filco306 opened this issue 5 months ago • 1 comments

Hi,

Thanks for a great package! I was wondering whether the current implementation actually supports directionality, since the adjacency matrix is symmetrized in prepare_page_rank_adjacency. This leads to the adjacency being symmetrical, and no consideration of directionality of the edges is taken into account. Am I wrong here, and if not, how would one best adapt to the case where the edges should actually be directed?

Thanks for a great package!

Filco306 avatar Aug 19 '25 09:08 Filco306

Hey 👋

Instead of providing the edge_index, you can also directly pass the adjacency matrix. The latter is not further normalized, but is checked by torch_ppr.utils.validate_adjacency.

For creating such matrices from edge indices, you can have a look at the individual steps in torch_ppr.utils.prepare_page_rank_adjacency.

mberr avatar Aug 19 '25 16:08 mberr