Skip to Content
数据分析之图算法: 基于Spark和Neo4j
book

数据分析之图算法: 基于Spark和Neo4j

by Mark Needham, Amy E. Hodler
September 2020
Intermediate to advanced
213 pages
5h 25m
Chinese
Posts & Telecom Press
Content preview from 数据分析之图算法: 基于Spark和Neo4j
路径查找算法和图搜索算法
57
Colchester 347.0 [Den Haag, Hoek van Holland, Felixstowe, Ipswich]
Immingham 369.0 []
Doncaster 443.0 [Immingham]
London 453.0 [Den Haag, Hoek van Holland, Felixstowe, Ipswich, Colchester]
结果列出了从根节点
Amsterdam
到图中其他各城市的物理距离(以千米为单位),按最短
距离排序。
4.6.3
 使用
Neo4j
实现单源最短路径算法
Neo4j
实现了单源最短路径算法的一个变体,称为
Delta-Stepping
算法,它将
Dijkstra
算法
划分为多个可并行执行的阶段。
下面的查询执行了
Delta-Stepping
算法:
MATCH
(n:Place {id:"London"})
CALL algo.shortestPath.deltaStepping.stream(n, "distance", 1.0)
YIELD nodeId, distance
WHERE
algo.isFinite(distance)
RETURN
algo.getNodeById(nodeId).id
AS
destination, distance
ORDER
BY
distance
查询的返回结果如下所示:
destination distance
London 0.0
Colchester 106.0 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

大数据项目管理:从规划到实现

大数据项目管理:从规划到实现

Ted Malaska, Jonathan Seidman
Presto实战

Presto实战

Matt Fuller, Manfred Moser, Martin Traverso
精實企業|高績效組織如何達成創新規模化

精實企業|高績效組織如何達成創新規模化

Jez Humble, Joanne Molesky, Barry O'Reilly

Publisher Resources

ISBN: 9787115546678