سؤال

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