|
4 | 4 | "cell_type": "markdown", |
5 | 5 | "metadata": {}, |
6 | 6 | "source": [ |
7 | | - "# ClosenessCentrality\n", |
| 7 | + "# Closeness Centrality\n", |
8 | 8 | "The _Closeness Centrality_ of a node measures the distance from that node to all other nodes.\n", |
9 | 9 | "Nodes with a high closeness score have the shortest distances to all other nodes.\n", |
10 | 10 | "The premise of this algorithm is that nodes with short distance to other nodes can spread information very efficiently through the network.\n", |
|
102 | 102 | " <tbody>\n", |
103 | 103 | " <tr>\n", |
104 | 104 | " <th>0</th>\n", |
105 | | - " <td>163</td>\n", |
106 | | - " <td>0.0</td>\n", |
| 105 | + " <td>191</td>\n", |
| 106 | + " <td>0.666667</td>\n", |
107 | 107 | " </tr>\n", |
108 | 108 | " <tr>\n", |
109 | 109 | " <th>1</th>\n", |
110 | | - " <td>164</td>\n", |
111 | | - " <td>0.0</td>\n", |
| 110 | + " <td>190</td>\n", |
| 111 | + " <td>0.571429</td>\n", |
112 | 112 | " </tr>\n", |
113 | 113 | " <tr>\n", |
114 | 114 | " <th>2</th>\n", |
115 | | - " <td>165</td>\n", |
116 | | - " <td>0.0</td>\n", |
| 115 | + " <td>192</td>\n", |
| 116 | + " <td>0.571429</td>\n", |
117 | 117 | " </tr>\n", |
118 | 118 | " <tr>\n", |
119 | 119 | " <th>3</th>\n", |
120 | | - " <td>166</td>\n", |
121 | | - " <td>0.0</td>\n", |
| 120 | + " <td>189</td>\n", |
| 121 | + " <td>0.400000</td>\n", |
122 | 122 | " </tr>\n", |
123 | 123 | " <tr>\n", |
124 | 124 | " <th>4</th>\n", |
125 | | - " <td>167</td>\n", |
126 | | - " <td>0.0</td>\n", |
| 125 | + " <td>193</td>\n", |
| 126 | + " <td>0.400000</td>\n", |
127 | 127 | " </tr>\n", |
128 | 128 | " </tbody>\n", |
129 | 129 | "</table>\n", |
130 | 130 | "</div>" |
131 | 131 | ], |
132 | 132 | "text/plain": [ |
133 | 133 | " nodeId centrality\n", |
134 | | - "0 163 0.0\n", |
135 | | - "1 164 0.0\n", |
136 | | - "2 165 0.0\n", |
137 | | - "3 166 0.0\n", |
138 | | - "4 167 0.0" |
| 134 | + "0 191 0.666667\n", |
| 135 | + "1 190 0.571429\n", |
| 136 | + "2 192 0.571429\n", |
| 137 | + "3 189 0.400000\n", |
| 138 | + "4 193 0.400000" |
139 | 139 | ] |
140 | 140 | }, |
141 | 141 | "execution_count": 4, |
|
145 | 145 | ], |
146 | 146 | "source": [ |
147 | 147 | "streaming_query = \"\"\"\n", |
148 | | - "CALL algo.closeness.stream('Node', 'LINKS') YIELD nodeId, centrality\n", |
| 148 | + "CALL algo.closeness.stream('Node', 'LINK') YIELD nodeId, centrality\n", |
149 | 149 | "RETURN nodeId,centrality order by centrality desc limit 20;\n", |
150 | 150 | "\"\"\"\n", |
151 | 151 | "\n", |
|
157 | 157 | ] |
158 | 158 | } |
159 | 159 | ], |
160 | | - "metadata": { |
161 | | - "kernelspec": { |
162 | | - "display_name": "Python 3", |
163 | | - "language": "python", |
164 | | - "name": "python3" |
165 | | - }, |
166 | | - "language_info": { |
167 | | - "codemirror_mode": { |
168 | | - "name": "ipython", |
169 | | - "version": 3 |
170 | | - }, |
171 | | - "file_extension": ".py", |
172 | | - "mimetype": "text/x-python", |
173 | | - "name": "python", |
174 | | - "nbconvert_exporter": "python", |
175 | | - "pygments_lexer": "ipython3", |
176 | | - "version": "3.6.0" |
177 | | - } |
178 | | - }, |
| 160 | + "metadata": {}, |
179 | 161 | "nbformat": 4, |
180 | 162 | "nbformat_minor": 2 |
181 | 163 | } |
0 commit comments