Pregunta

I have a graph in which nodes have string ids, not integer. That is the graph file is like below:

 *Vertices 4
 *edges
 A B
 B C
 D A

I use a PajekNetReader to load the graph from the file and it gives me an error saying "the ids must be integer". How can I load a graph with string lds in JUNG?

No hay solución correcta

Otros consejos

The Pajek format that JUNG supports requires the vertex ids to be integers. You can give them labels, however: see http://jung.sourceforge.net/doc/api/edu/uci/ics/jung/io/PajekNetReader.html for details on the format.

Other options include using a different format and writing your own parser.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top