CWTSLeiden / networkanalysis

Java package that provides data structures and algorithms for network analysis.
MIT License
145 stars 33 forks source link

Can't get results #20

Closed piyushapple1998 closed 11 months ago

piyushapple1998 commented 2 years ago

Hello! I deployed the jar file using the following command: java -cp networkanalysis-1.1.0.jar nl.cwts.networkanalysis.run.RunNetworkClustering -r 1 -o out.txt input.txt

and I get this error: "Error while creating network: Elements of neighbors array must have non-negative values."

Could you please help out? Thank you!

wolfram77 commented 11 months ago

This is more than a year later, but I am getting a similar error.

Reading edge list from '/home/subhajit.sahu/Data/web-Stanford.mtx.tsv'.
Error while creating network: For each node, corresponding elements of neighbors array must not include duplicate values.

I am using graphs in Matrix Market format from the SuiteSparse Matrix collection, and converting to a TSV file with a script. Is this because some vertex u have duplicate edges v (do such duplicate edges exist in the dataset), or is it due to self-loops?

vtraag commented 11 months ago

I get this error: "Error while creating network: Elements of neighbors array must have non-negative values."

Could you please help out? Thank you!

The message is reasonably self-explanatory I think? It means that for some reason your input file contained a negative value. I'm not sure what's wrong with the input file, but you'd probably want to double check.

P.S. Apologies for the late reply!

vtraag commented 11 months ago

Thanks for bumping the issue @wolfram77 !

I am getting a similar error.

Reading edge list from '/home/subhajit.sahu/Data/web-Stanford.mtx.tsv'.
Error while creating network: For each node, corresponding elements of neighbors array must not include duplicate values.

Well, it's actually a quite distinct error. Indeed, for some reason your input file contains duplicate values. It's not about self-loops. Do note that the input is expecting only one pair of nodes (unless you provide a pre-sorted edge list, see --sorted-edge-list), so if it already contains the link 0 1 you shouldn't also have 1 0 in there.

wolfram77 commented 11 months ago

Oh, the web-Stanford is a directed graph. I will convert it to an undirected one and try again. Thanks.