Mmmmm.... I can get vertexId and its 1st value, System.out.println("Vertex Id: " + vertex.getId() + " - Value " + vertex.getValue()), but how can I get the vertex 2nd value?

Assist me please...


El 02/06/2015 a las 8:59, Laxmidhar escribió:
On Monday 01 June 2015 04:45 PM, Cristian Vidal Silva wrote:
Hey everyone.

Currently, I need to read vertices in the format [Id, Val1, Val2,
[[taget1, weight1], [target2, weight2]..]], and I want out  simply
simply , for each vertex, the sum of its values... For example,
tiny_graph.txt is:

[0,1,2,[[1,1],[3,3]]]
[1,3,4,[[0,1],[2,2],[3,1]]]
[2,5,5,[[1,2],[4,4]]]
[3,6,7,[[0,3],[1,1],[4,4]]]
[4,8,9,[[3,4],[2,4]]]

So, the output would be like:
0,3
1,7
2,10
3,13
4,17

What must I do to achieve this goal? What classes Do I have to define?
How Do I link these classes?

I hope to get replies to get this goal to advance on my research.

Hi Silva,

No need of defining anything for that you need to change your logic in
compute() method of your class.And take the 1st argument as your source
id of your each line then add the value of its.


Thanks
Laxmidhar

--
Cristian Vidal Silva
Computer Engineer
Master in Computer Science, University of Concepcion - Chile
Master of Science in Computer Science, Michigan State University, MI - USA
Ph.D(c) in Software Engineering and Technology, University of Seville - Spain

Chilean Fulbright Scholar

Reply via email to