Hi everyone ,
I am applying the HITS algorithm (Kleinberg, 1999) in my research and came across a strange issue: The results of the HITS algorithm differ between R, Python and Mathematica. Importantly, the results differ not only in their relative weight, but also in which nodes get assigned which weight.
Below, you find an example of how the code and the output look like (scroll to the end for code as text).
I am not astonished, that the weights are different between the three software packages, but also the relative weights are different!
Do you have any idea, where these differences might come from? Are the implementations of the algorithm different between the packages?
Would that mean that scientific results using the HITS algorithm are likely software specific?
Please note that I am not using the igraph implementation in python or mathematica.
Thanks a lot for clarifying this issue to me
I am working on a Microsoft Windows 10; Version 10.0.19042
The igraph version is 1.2.6.; R is in version 4.0.3 (2020-10-10) “Bunny-Wunnies Freak Out”
Code as text:
Mathematica:
HITSCentrality[Graph[{1 -> 3, 2 -> 1, 3 -> 6, 4 -> 6, 1 -> 5, 5 -> 4, 6 -> 1}]]
R:
library(igraph);
g2 <- graph_from_literal(2-+1-+5-+4-+6-+1,1-+3-+6);
plot(g2);
hub_score(g2, scale=TRUE)$vector;
authority_score(g2)$vector
Python:
import networkx as nx
from networkx.algorithms import community
G = nx.DiGraph()
G.add_nodes_from([1,2,3,4,5,6])
G.add_edges_from([(1,3),(2,1),(3,6),(4,6),(1,5), (5,4), (6,1)])
print(nx.hits(G))