snap-stanford / snap

Stanford Network Analysis Platform (SNAP) is a general purpose network analysis and graph mining library.
Other
2.17k stars 797 forks source link

Node2vec: node id becomes negative? #105

Closed flyingkid-ntu closed 7 years ago

flyingkid-ntu commented 7 years ago

In my edgelist file, all the ids are postive. However, in the embedding file, some ids become negative. Anyone knows whats happening here? Can I convert the negative ids back?

hhromic commented 7 years ago

Hi, check if your Ids are larger than 2**31 - 1, if this is the case, you are overflowing the internal id representation TInt, which is signed 32 bits. You can try to use the experimental snap-64 repository which supports TInt64 for ids (maximum of 2**63 - 1), or convert your ids to strings so SNAP can re-index them. In this case your limit is no more than 2**31 - 1 total nodes.

check this comment: https://github.com/snap-stanford/snap/issues/111#issuecomment-318178021

Cheers!