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
路径查找算法和图搜索算法
53
由于要求结果按降序排列(
DESC
),因此上述输出结果给出了关系最多的
10
对地点。
如果要计算最短加权路径,就不能将
null
作为第
1
个参数,可以传递含有最短路径计算所
需代价值的性质名称(
distance
)。利用该性质可以计算每对节点之间的最短加权路径。
下面的查询可实现上述操作:
CALL algo.allShortestPaths.stream("distance")
YIELD sourceNodeId, targetNodeId, distance
WHERE
sourceNodeId < targetNodeId
RETURN
algo.getNodeById(sourceNodeId).id
AS
source,
algo.getNodeById(targetNodeId).id
AS
target,
distance
ORDER BY
distance
DESC
LIMIT
10
该查询的返回结果如下所示:
source target distance
Doncaster Hoek van Holland 529.0
Rotterdam Doncaster 528.0
Gouda Doncaster 524.0
Felixstowe Immingham 511.0
Den Haag Doncaster 502.0
Ipswich Immingham 489.0
Utrecht Doncaster 489.0
London Utrecht 460.0
Colchester ...
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.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

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

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

Jez Humble, Joanne Molesky, Barry O'Reilly
初探深度學習|使用TensorFlow

初探深度學習|使用TensorFlow

Reza Zadeh, Bharath Ramsundar
Presto实战

Presto实战

Matt Fuller, Manfred Moser, Martin Traverso
大数据项目管理:从规划到实现

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

Ted Malaska, Jonathan Seidman

Publisher Resources

ISBN: 9787115546678