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
52
4
Immingham [Immingham 0, Colchester 3, Hoek van Holland 3]
Ipswich [Colchester 1, Hoek van Holland 2, Immingham 4]
London [Colchester 1, Immingham 2, Hoek van Holland 4]
Rotterdam [Hoek van Holland 1, Immingham 3, Colchester 4]
Utrecht [Immingham 2, Hoek van Holland 3, Colchester 5]
distances
列中每个地点旁边的数字表示从源节点到目的地所需穿越的城市之间的关系
(道路)数量。在本例中,
Colchester
是目的地之一,从它出发要穿越
0
个节点,但是从
Immingham
Hoek van Holland
出发就要经过
3
跳。在规划旅行路线时,利用这些信息有
助于我们在目的地尽情畅游。
4.5.4
 使用
Neo4j
实现所有点对最短路径算法
Neo4j
提供了所有点对最短路径算法的并行实现,将返回每对节点之间的距离。
该程序的第
1
个参数用于计算最短加权路径的性质。如果将其设为
null
,那么算法将计算
所有节点对之间的无权最短路径。
查询实现如下:
CALL algo.allShortestPaths.stream(null)
YIELD sourceNodeId, ...
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