Embed a directed graph as an undirected graph using GraphX

I have the following oriented graph defined by nodes and edges below.

Knots

1,2,3,4,5 

The edges

 (1,2),(1,3),(1,4),(2,5),(3,4),(3,5),(4,5) 

How to convert this directed graph to an undirected graph I need to convert using the built-in method. If there is a build method, what method is this ?. Or I need to add edges manually to the dataset, e.g. (1,2) - (2,1).

+7
scala graph apache-spark spark-graphx
source share
1 answer

You do not need to convert your chart into an undirected graph. You just have to consider it as an undirected graph (just ignoring the direction of the edge).

For example, if you use collectNeighbors , you can force it to act as an undirected graph by passing EdgeDirection Or as a parameter.

+9
source share

All Articles