hdvvip/CS224W_Winter2021

Some mistakes in colab 1

Closed this issue · 3 comments

  1. For Q4, networkx closeness centrality returns the normalized closeness directly, which is different from the raw (unnormalized) one that we learned in the lecture. You should add closeness = closeness * (G.number_of_nodes() - 1) in your code.
  2. For Q6, you directly used edge_1 in is_neg_edge(), which causes your outputs to be wrong.

Thanks Angus for the comment,

  1. Following the equation in Q4, the calculation should be
    raw closeness centrality(node) = 1 / sum(distance from node to all other nodes)
    https://neo4j.com/docs/graph-data-science/current/algorithms/closeness-centrality/

Last version, I think the implement version by networkX is better so I just use the normalized version by NetworkX
In the new commit, I added the raw closeness centrality calculation following the equation in Q4.

  1. You're right. Thank you so much!

For Q3, I think r0 should be updated with the r values of the neighbors of node 0, not r0 itself.

Thank you!
I just fix that in the new commit.