Does Martin's answer to a similar thread help? https://lists.apache.org/thread.html/ 000af2fb17a883b60f4a2359ebbeca42e3160c2167a88995c2ee28c2@ %3Cuser.flink.apache.org%3E
On Monday, 29 May 2017 19:38:20 CEST Martin Junghanns wrote: > Hi Ali :) > > You could compute the degrees beforehand (e.g. using the > Graph.[in|out|get]degrees()) methods and use the resulting dataset as a > new vertex dataset. You can now run your vertex-centric computation and > access the degrees as vertex value. > > Cheers, > > Martin On Sunday, 28 May 2017 12:02:52 CEST Daniel Dalek wrote: > Hi all, > > I have a question related to Gelly and graph filtering and hoping to get > some pointers/input. > > Basically I have a bipartite graph prepared for a signal/collect iteration, > but want to prune it first to only include target nodes with x or more > edges (indegree >= x). To filter on vertex value (or id) it seems > straightforward to use subgraph and FilterFunction: > > prunedG = graph.subgraph( > new FilterFunction<Vertex<String, String>>() { > public boolean filter(Vertex<String, String> vertex) { > return (vertex.getValue() > 0); > } > }, ... > > > Modifying this to call something like "return (vertex.getInDegree() >=x)" > seemed appropriate but the degree information is in the graph (or available > as separate methods when running GatherFunction etc), and not accessible > directly from the vertex object inside the filter function. > > Any suggestions on how to accomplish this?
signature.asc
Description: This is a digitally signed message part.