Hi Marc,
You can do such a map on your edges dataset that switches the
direction of edges if the source id is bigger than the target id. So
your MapFunction will have an if, which checks whether the source id
is bigger than the target id, and if it is bigger, than returns the
edge reversed, else r
Hi Gábor and anyone else ;-) ,
I need your help again.
My goal is a graph without self-loops and sum all edge values between two
vertices into one single edge (both direction).
e.g. my input graph is described by:
1 2 10
1 2 10
2 1 10
1 1 1
1 3 5
The result has to be:
1 2 30 (sum and reduce all
Hi Gábor,
thanks a lot
Best,
Marc
> Am 17.04.2017 um 20:32 schrieb Gábor Gévay :
>
> Hello Marc,
>
> You can group by edge, and then sum:
>
> edges
> .groupBy(0,1) // make first two fields a composite key
> .sum(2); // sum the value field
>
> This will turn multiple edges that have the sam
Hello Marc,
You can group by edge, and then sum:
edges
.groupBy(0,1) // make first two fields a composite key
.sum(2); // sum the value field
This will turn multiple edges that have the same source and target
into one edge, whose value will be the sum of the values of the
original group of e
Hi,
how can I sum and reduce multiple edges in my entire graph?
e.g. my input graph looks like (source-ID, target-ID, value):
(1, 2, 30)
(1, 2, 10)
(2, 1, 55)
And I need:
(1, 2, 40)
(2, 1, 55)
Thanks!
Marc