From: SourceForge.net <no...@so...> - 2005-12-27 05:53:01
|
Read and respond to this message at: https://sourceforge.net/forum/message.php?msg_id=3494212 By: shehjar Hi Everyone, I am trying to read in a graph using the PajekNetReader class but its not reading in the vertex labels in the file. Here the cleansed code: PajekNetReader pjkreader = new PajekNetReader(true); //toggling to false doesnt work either. Graph init_graph = new SparseGraph(); EdgeWeightLabeller elblr = EdgeWeightLabeller.getLabeller(init_graph); init_graph = pjkreader.load(args[0], init_graph, elblr); //args[0] does have a filename in it Iterator iter = init_graph.getVertices().iterator(); StringLabeller lblr = StringLabeller.getLabeller(init_graph); while(iter.hasNext()) { System.out.println("LABEL: " + lblr.getLabel((Vertex)iter.next())); } ====== The while loop at the end just prints LABEL: null 10 times, which is the number of vertices in my pajek file. TIA, and a happy new year. Shehjar ______________________________________________________________________ You are receiving this email because you elected to monitor this forum. To stop monitoring this forum, login to SourceForge.net and visit: https://sourceforge.net/forum/unmonitor.php?forum_id=252062 |