[phpBB Debug] PHP Warning: in file [ROOT]/phpbb/session.php on line 583: sizeof(): Parameter must be an array or an object that implements Countable
[phpBB Debug] PHP Warning: in file [ROOT]/phpbb/session.php on line 639: sizeof(): Parameter must be an array or an object that implements Countable
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4516: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3262)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4516: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3262)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4516: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3262)
Gephi forums •Calculate weight by number of parallel edges?
Page 1 of 1

Calculate weight by number of parallel edges?

Posted: 14 Jun 2016 16:43
by bspitch
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

Re: Calculate weight by number of parallel edges?

Posted: 14 Jun 2016 19:42
by totetmatt
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

Re: Calculate weight by number of parallel edges?

Posted: 14 Jun 2016 21:31
by bspitch
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?