You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 22, 2020. It is now read-only.
| stats | boolean | true | yes | if stats about centrality should be returned
100
100
| writeProperty | string | 'centrality' | yes | property name written back to
101
101
| graph | string | 'heavy' | yes | use 'heavy' when describing the subset of the graph with label and relationship-type parameter, 'cypher' for describing the subset with cypher node-statement and relationship-statement
102
-
| concurrency | int | 1 | yes | if concurrency is set and > 1 parallel BC is used. It spawns N(given by the concurrency param) concurrent threads for calculation where each one calculates the BC for one node at a time
103
-
104
-
102
+
| concurrency | int | available CPUs | yes | number of concurrent threads
105
103
|===
106
104
107
105
.Results
@@ -134,7 +132,7 @@ YIELD nodeId, centrality - yields centrality for each node
134
132
| name | type | default | optional | description
135
133
| label | string | null | yes | label to load from the graph, if null load all nodes
136
134
| relationship | string | null | yes | relationship-type to load from the graph, if null load all relationships
137
-
| concurrency | int | 1 | yes | if concurrency is set and > 1 parallel BC is used. It spawns N(given by the concurrency param) concurrent threads for calculation where each one calculates the BC for one node at a time
135
+
| concurrency | int | available CPUs | yes | number of concurrent threads
138
136
| direction | string | outgoing | yes | relationship direction to load from the graph, if 'both' treats the relationships as undirected
Copy file name to clipboardExpand all lines: doc/label-propagation.adoc
+46-6Lines changed: 46 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,14 +6,14 @@ The intuition of label flooding is that a single label can quickly become domina
6
6
The labels are expected to be trapped inside a densely connected group of nodes.
7
7
Based on the idea of local trapping of labels, the author proposed a local community detection method where a node is initialized with a label and propagates step by step through the neighbours until the end of the community is reached.
8
8
The end of the community indicates the number of edges proceeding outward from the community and drops below a threshold value.
9
-
LPA is a method which is effective, simple and near-linear time algorithm.
9
+
LPA is a method which is effective, simple and near-linear time algorithm.[1]
10
10
Community detection is an important methodology for understanding the organization of various real-world networks and has applications in problems as diverse as consensus formation in social communities or the identification of functional modules in biochemical networks.
11
11
12
12
== History, Explanation
13
13
14
14
15
15
Many community detection algorithms have been proposed and utilized with varying degrees of effectiveness in the community detection research.
16
-
_Label Propagation_ which was first proposed by Raghavan et al. (2007) uses unique identifiers of nodes as labels and propagates the labels based on an agreement with the majority of the neighbour nodes and each node selects a label from its neighbourhood to adopt it as its label.
16
+
_Label Propagation_ which was first proposed by Raghavan et al. (2007)https://arxiv.org/pdf/0709.2938.pdf[[2\]] uses unique identifiers of nodes as labels and propagates the labels based on an agreement with the majority of the neighbour nodes and each node selects a label from its neighbourhood to adopt it as its label.
17
17
LPA works as follows: Node x has neighbours and each neighbour carries a label denoting the community to which they belong to.
18
18
Each node in the network chooses to join the community to which the maximum number of its neighbours belongs to, with ties broken uniformly and randomly.
19
19
At the beginning, every node is initialized with unique label (called as identifier) and the labels propagate through the network.
@@ -23,7 +23,7 @@ At end of the propagation, most labels disappear and only few labels exist in th
23
23
Label propagation algorithm reaches convergence when each node has the majority label of its neighbours.
24
24
At the end of the convergence, nodes connected with the same label form a community.
25
25
According to LPA, communities are defined as nodes having identical labels at convergence.
26
-
The agreement between the nodes to spread the labels forms the basis for _Label Propagation_ algorithms.
26
+
The agreement between the nodes to spread the labels forms the basis for _Label Propagation_ algorithms.[1]
27
27
28
28
== When to use it / use-cases
29
29
@@ -40,6 +40,11 @@ _Label Propagation_ algorithms (LPA) are such type of algorithms that detects co
40
40
41
41
== Constraints / when not to use it
42
42
43
+
In contrast with other algorithms label propagation can result in various community structures from the same initial condition.
44
+
The range of solutions can be narrowed if some nodes are given preliminary labels while others are held unlabelled.
45
+
Consequently, unlabelled nodes will be more likely to adapt to the labelled ones.
46
+
For a more accurate finding of communities, Jaccard’s index is used to aggregate multiple community structures, containing all important information.[2]
Our algorithm found two communities with 3 members each.
77
+
78
+
=== Using pre-defined labels
79
+
80
+
_At the beginning of the algorithm, every node is initialized with unique label (called as identifier) and the labels propagate through the network._
81
+
82
+
It is possible to define preliminary labels (identifiers) of nodes using `partition` parameter.
83
+
We need to save preliminary set of labels we would like to run the LPA algorithm with as a property of nodes (must be a number).
84
+
In our example graph we saved them as property _predefined_label_.
85
+
Algorithm first checks if there is a _predefined label_ assigned to the node and loads it, if there is one.
86
+
If there isn't one it assigns the node new unique label(node id are used).
87
+
Using this preliminary set of labels (identifiers) it then sequentially updates each node's label to a new one, which is the most frequent label among its neighbors at every label propagation step(iteration).
88
+
89
+
Can be used as semi-supervised way of finding communities, where we hand-pick some initial communities.
| concurrency | int | available CPUs | yes | number of concurrent threads
80
118
| iterations | int | 1 | yes | the maximum number of iterations to run
81
119
| weightProperty | string | 'weight' | yes | property name that contains weight. Must be numeric.
82
-
| partitionProperty | string | 'partition' | yes | property name written back the partition of the graph in which the node reside
120
+
| partitionProperty | string | 'partition' | yes | property name written back the partition of the graph in which the node reside, can be used to define initial set of labels (must be a number)
83
121
| write | boolean | true | yes | if result should be written back as node property
84
122
85
123
|===
@@ -116,9 +154,11 @@ We support the following versions of the label propagation algorithms:
For now only single-source shortest path support loading the relationship as undirected, but we can use cypher loading to help us solve this.
88
+
Undirected graph can be represented as https://en.wikipedia.org/wiki/Bidirected_graph[Bidirected graph], that is a directed graph in which the reverse of every relationship is also a relationship.
89
+
90
+
We do not have to save this reversed relationship, we can project it using *cypher loading*.
91
+
Note that relationship query does not specify direction of the relationship.
92
+
This is applicable to all other algorithms, that use *cypher loading*.
93
+
94
+
.Running all pairs shortest path treating the graph as undirected
0 commit comments