Calculate weight by number of parallel edges?

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
bspitch
Posts:8
Joined:06 Jun 2016 19:32
[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
Calculate weight by number of parallel edges?

Post by bspitch » 14 Jun 2016 16:43

Hello,

I am trying to calculate an edge weight based on the number of parallel edges between nodes. For example, my data include:

source, dest, weight
A, B, 1
A, C, 1
B, C, 1
B, C, 1
B, C, 1

In the above example, I would like to display the data as:
A, B, 1
A, C, 1
B, C, 3

Is there a way to do this? I am using the streaming plugin from an OrientDB database.

Thank you

User avatar
totetmatt
Posts:14
Joined:12 May 2016 19:04
Location:München
Contact:

Re: Calculate weight by number of parallel edges?

Post by totetmatt » 14 Jun 2016 19:42

If the weight is only 1 for each edges :
Having this file

Code: Select all

A;B
A;C
B;C
B;C
B;C
And just File >> Open on Gephi will do the job

If you have a weight that can be different than 1, I think it's not possible to do it in CSV. Then create a gdf file like this

Code: Select all

nodedef>name VARCHAR
A
B
C
edgedef>node1 VARCHAR,node2 VARCHAR,weight DOUBLE
A,B,1
A,B,5
A,C,1
B,C,1
B,C,1
B,C,1
And File >> Open do the job correctly

bspitch
Posts:8
Joined:06 Jun 2016 19:32
[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: Calculate weight by number of parallel edges?

Post by bspitch » 14 Jun 2016 21:31

Thank you. I believe my question may not have been as clearly articulated as I had hoped. Perhaps a little more detail on my project will make sense.

I am working on a dynamic network visualization and would like to see the edges grow as well as the nodes. The columns in my actual data file are:
(Source, Target, Type, Id, Label, Interval, Weight, firstDate, secondDate, otherVar, and otherVar2). I believe I am getting multiple edges between the same nodes because the variables are different. For my dynamic visualization, however, I would like to combine the weights between the same source and targets regardless of the values of other variables. Is this possible?

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