How to save community information on a chart

I have several graphical databases (network of friends, purchase history, etc.) that I save with Neo4j. I plan to analyze them using community discovery algorithms such as Girvan Newman . These algorithms usually return a dendrogram , representing the separation of the graph from the entire network to individual nodes. I am wondering how I can persist in these results. I believe that it can be stored as a separate graph, but is there a way to save it inside the graph itself? My concern with this is the need to create nodes to represent groups, which I would like to avoid.

+4
source share
2 answers

One way to represent a dendrogram is to list pairs that contain (n-1) pairs for n elements. Assuming that the left element of the pair is the one whose identifier is stored to indicate all elements in the community, the dendrogram pattern may look like

[[0,1],[2,3],[0,2]] 

So, an alternative way to save data that can be stored on each node, at what time step it is combined into another node (along with all the nodes that were previously combined into it).

So, you would add (0: 0) to 1, (1: 2) to 3 and (2: 0) to 2 (timestep: the new "name" node).

edit: Specifically, this could mean joining two integer attributes, for example. 'merge_timestep' and 'merge_into' for each Neo4J node object.

+4
source

Most community detection algorithms work by agglomerating communities along existing edges in a graph; Girvan-Newman is a little unusual in that it works with cutting edges. In any case, the dendrogram can be considered as showing the order of operations at the edges of the graph. Thus, instead of storing the dendrogram as a separate object, you can attach properties to the edges (relations), showing in which order they should be combined / cut. My knowledge of Neo4j is extremely limited, so I will leave the details to you.

There are several complications when merging, as there will usually be multiple equivalent edges, each of which connects different vertices within the communities for merging. Basically, just select a strategy that will allow you to identify related communities from the edges.

+4
source

Source: https://habr.com/ru/post/1384717/


All Articles