質問

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?

正しい解決策はありません

他のヒント

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.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top