Pregunta

How do you construct a csv for a bipartite graph. I have the following data set:

ID, Source, Target, Weight
1,00ash00,t3_ascto,-1
2,00ash00,t3_asll7,1
3,00ash00,t3_atawm,1
4,00ash00,t3_avosd,1
5,0-0,t3_6vlrz,1
6,0-0,t3_6vmwa,1
7,0-0,t3_6wdiv,1
8,0-0,t3_6wegp,1
9,0-0,t3_6wegz,1
10,00-,t3_ajdu3,-1

Source and Target columns represent the from-to aspect in a bipartite graph. I read somewhere that inorder to generate a graph, you need a node csv file(a mapping of the IDs with nodes) and an edges csv files. So how do i convert the above dataset and use it in these two files?

In case my approach is not right, suggest another approach?

¿Fue útil?

Solución

Yes, that seems to be an OK example of CSV "spreadsheets" that gephi can import, except for one thing: it doesn't work with the space before each column name. So the column names should appear as follows in the file:

ID,Source,Target,Weight

Then by creating a new project or using an existing one, and by clicking the "Data Laboratory" button between "Overview" and "Preview", it should be no problem to import the file into a gephi edges table.

Additional observations:

  • It's a bipartite graph in that no source is a target and no target is a source.
  • If you want to import it as an undirected graph, you can add a "Type" column that has the value "Undirected" for each edge (that is, row).
  • Is the source identifier 00- perhaps intended to be 0-0? It's oddly similar.
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top