Question

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 correct solution

OTHER TIPS

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top