Skip to content

Instantly share code, notes, and snippets.

@friso
Created January 29, 2012 13:03
Show Gist options
  • Save friso/1698726 to your computer and use it in GitHub Desktop.
Save friso/1698726 to your computer and use it in GitHub Desktop.
Step 3: for each node find the largest partition ID that it belongs to
-- Input:
part. source adjacency
ID node list
29 28 29,23
26 20 26,25,24,23,22,21
-- Create records:
source node partition
node
28 28 29
28 29 29
28 23 29
20 20 26
20 26 26
20 25 26
20 24 26
20 23 26
20 22 26
20 21 26
-- Group by node:
Group for node 28 =
28 28 29
Group for node 29 =
28 29 29
Group for node 23 (mind the ordering) =
28 23 29
20 23 26
Group for node 20 =
20 20 26
Remainder snipped...
-- Output:
source node partition
node
28 28 29
28 29 29
28 23 29
20 20 26
20 26 26
20 25 26
20 24 26
20 23 29 <=== THIS ONE GOT UPDATED FROM 26 to 29!
20 22 26
20 21 26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment