This question is about Spark GraphX. I want to compute a subgraph by removing nodes that are neighbors of certain other nodes.
Example
[Task] Retain A nodes and B nodes that are not neighbors of C2 nodes.
Input graph:
┌────┐
┌─────│ A │──────┐
│ └────┘ │
v v
┌────┐ ┌────┐ ┌────┐ ┌────┐
│ C1 │────>│ B │ │ B │<────│ C2 │
└────┘ └────┘ └────┘ └────┘
^ ^
│ ┌────┐ │
└─────│ A │──────┘
└────┘
Output graph:
┌────┐
┌─────│ A │
│ └────┘
v
┌────┐
│ B │
└────┘
^
│ ┌────┐
└─────│ A │
└────┘
How to elegantly write a GraphX query that returns the output graph?