Ranking Number of Neighbours

Visual manipulations and refinements
Post Reply [phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable
Tatteo
Posts:2
Joined:08 Nov 2017 13:08
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable
Ranking Number of Neighbours

Post by Tatteo » 08 Nov 2017 14:45

Hello,

Apologies if this question has already been asked. I have looked around, but cannot find any other instances.

I am having issues analysing a dataset. In the dataset I have some instances of multiple edges connecting the same two nodes. My problem, multiplied by a few thousand rows, is that I have something like:

A - B
B - A
A - C
C - B

What I would like to calculate is the number of neighbours that each node has.

I thought I could just calculate their degree, but this is influenced by the fact that some nodes are linked twice. So A's degree would be ranked 3 when it actually has 2 neighbours.

So my question is: is there a way to
a) rank nodes by number of neighbours instead of by degree
OR
b) merge duplicate edges with nodes in opposite order.

Thanks a lot!

User avatar
eduramiba
Gephi Code Manager
Posts:1064
Joined:22 Mar 2010 15:30
Location:Madrid, Spain
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable

Re: Ranking Number of Neighbours

Post by eduramiba » 08 Nov 2017 14:51

Yeah, when you import the file, during import report you can choose the edges merge strategy

Tatteo
Posts:2
Joined:08 Nov 2017 13:08
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable

Re: Ranking Number of Neighbours

Post by Tatteo » 10 Nov 2017 12:14

Thanks, it works!

Daily lesson: make sure you are running the latest version of the software. :)

User avatar
eduramiba
Gephi Code Manager
Posts:1064
Joined:22 Mar 2010 15:30
Location:Madrid, Spain
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable

Re: Ranking Number of Neighbours

Post by eduramiba » 10 Nov 2017 12:32

Great! Yeah I forgot to mention you need 0.9.2

Post Reply
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable