Hi Hai, removeEdges() only removes edges from the vertex you have called this function on. So, if you call it on vertex 0 and request to remove edges to vertex 0, it will only remove one specific edge in your case [0 -> 0]. If you need to remove all edges that point to vertex 0 you need to call removeEdges(new LongWritable(0)) on all vertices.
Regards, Sergey Edunov On Fri, Sep 23, 2016 at 8:15 AM, Hai Lan <lanhai1...@gmail.com> wrote: > Dear all, > > I am new to Giraph and facing a problem to remove edges. I'm trying to > remove all edges pointed to some specific vertexes before next superstep. > e.g. vertex value =0 by using > > removeEdges() > > my input file are like: > [0,0.0,[[0,0]]] > [1,1.0,[[0,0]]] > [2,1.0,[[0,0],[1,0]]] > [3,1.0,[[0,0],[1,0],[2,0]]] > > After I used removeEdges(vertex.getId()), I used vertex.getNumEdges() to > count how many edges left. The problem is : > my expected output should be the outdegree of 0,1,2,3 are 0,0,1,2 cause edge > to vertex 0 is removed. However, it seems like edge of vertex 0 is removed > cause edge of vertex 0 became 0. However, other vertex edge number just > remained the same, like vertex 1 still be 1 though it has an edge pointed to > 0. > BTW, I used JsonLongDoubleFloatDoubleVertexInputFormat to input. > > Does anyone have idea about this? > > Thank you so much for your help. > > Best, > > Hai