Skip to content

Commit a75ec30

Browse files
committed
support weighted degree centrality
1 parent 22eba90 commit a75ec30

File tree

4 files changed

+9
-1
lines changed

4 files changed

+9
-1
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55

66
### Bug Fixes
77
1. Fix a bug where disconnected nodes were not projected.
8-
1. Fix a bug where multiple nodes containing the identifying name could be nondeterministically matched. The user must now specify the exact name.
8+
2. Fix a bug where multiple nodes containing the identifying name could be nondeterministically matched. The user must now specify the exact name.
9+
3. Support weighted degree centrality.
910

1011
### Other Changes
1112

mcp_server/src/mcp_server_neo4j_gds/centrality_algorithm_handlers.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,7 @@ def execute(self, arguments: Dict[str, Any]) -> Any:
213213
nodes=arguments.get("nodes"),
214214
nodeIdentifierProperty=arguments.get("nodeIdentifierProperty"),
215215
orientation=arguments.get("orientation"),
216+
relationshipWeightProperty=arguments.get("relationshipWeightProperty"),
216217
)
217218

218219

mcp_server/src/mcp_server_neo4j_gds/centrality_algorithm_specs.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,10 @@
190190
"type": "string",
191191
"description": "The orientation used to compute node degrees. Supported orientations are NATURAL (for out-degree), REVERSE (for in-degree) and UNDIRECTED (for both in-degree and out-degree) ",
192192
},
193+
"relationshipWeightProperty": {
194+
"type": "string",
195+
"description": "Property of the relationship to use for weighting. If not specified, all relationships are treated equally.",
196+
},
193197
},
194198
"required": [],
195199
},

mcp_server/tests/test_centrality_algorithms.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,8 @@ async def test_degree_centrality(mcp_client):
239239
{
240240
"nodes": ["King's Cross St. Pancras", "Oxford Circus"],
241241
"nodeIdentifierProperty": "name",
242+
"orientation": "NATURAL",
243+
"relationshipWeightProperty": "distance",
242244
},
243245
)
244246

0 commit comments

Comments
 (0)