Skip to Content
For Enterprise
For Government
For Higher Ed
For Individuals
For Marketing
For Enterprise
For Government
For Higher Ed
For Individuals
For Marketing
Explore Skills
Cloud Computing
Microsoft Azure
Amazon Web Services (AWS)
Google Cloud
Cloud Migration
Cloud Deployment
Cloud Platforms
Data Engineering
Data Warehouse
SQL
Apache Spark
Microsoft SQL Server
MySQL
Kafka
Data Lake
Streaming & Messaging
NoSQL Databases
Relational Databases
Data Science
Pandas
R
MATLAB
SAS
D3
Power BI
Tableau
Statistics
Exploratory Data Analysis
Data Visualization
AI & ML
Generative AI
Machine Learning
Artificial Intelligence (AI)
Deep Learning
Reinforcement Learning
Natural Language Processing
TensorFlow
Scikit-Learn
Hyperparameter Tuning
MLOps
Programming Languages
Java
JavaScript
Spring
Python
Go
C#
C++
C
Swift
Rust
Functional Programming
Software Architecture
Object-Oriented
Distributed Systems
Domain-Driven Design
Architectural Patterns
IT/Ops
Kubernetes
Docker
GitHub
Terraform
Continuous Delivery
Continuous Integration
Database Administration
Computer Networking
Operating Systems
IT Certifications
Security
Network Security
Application Security
Incident Response
Zero Trust Model
Disaster Recovery
Penetration Testing / Ethical Hacking
Governance
Malware
Security Architecture
Security Engineering
Security Certifications
Design
Web Design
Graphic Design
Interaction Design
Film & Video
User Experience (UX)
Design Process
Design Tools
Business
Agile
Project Management
Product Management
Marketing
Human Resources
Finance
Team Management
Business Strategy
Digital Transformation
Organizational Leadership
Soft Skills
Professional Communication
Emotional Intelligence
Presentation Skills
Innovation
Critical Thinking
Public Speaking
Collaboration
Personal Productivity
Confidence / Motivation
Features
All features
Verifiable skills
AI Academy
Courses
Certifications
Interactive learning
Live events
Superstreams
Answers
Insights reporting
Radar Blog
Buy Courses
Plans
Sign In
Try Now
O'Reilly Platform
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
50
|
第
4
章
4.5.1
近观所有点对最短路径算法
按照运算步骤的顺序很容易理解所有点对最短路径算法的计算过程。图
4-8
演示了节点
A
的处理步骤。
所有节点的初始距离
设置为
∞
,之后起始
节点的距离设置为
0
第
1
步
从
A
出发
第
2
步
从
A
到
C
再到
下一节点
第
3
步
从
A
到
B
再到
下一节点
第
4
步
从
A
到
E
再到
下一节点
第
5
步
从
A
到
D
再到
下一节点
每一步都保留或更新到目前为止计算出的最小值
仅给出从节点A到其他各节点的计算步骤
图
4-8
:计算从节点
A
到其他各节点最短路径的步骤,更新步骤用阴影标出
该算法最初假定到所有节点的距离都为无穷大。选定起始节点后,将到该节点的距离设为
0
。计算过程如下。
1.
从起始节点
A
开始,计算移动到可达节点的代价并更新值。为了寻找最小值,可以选择
B
(代价为
3
)或
C
(代价为
1
)。选定
C
作为下一阶段遍历的起始节点。
2.
现在从节点
C
开始,算法更新从
A
到那些直接由
C
可达的节点的累计距离。只有当代
价更小时,才会更新值。
A=0, B=3, C=1, D=8, E=
∞
3.
然后选择
B
作为未访问的下一最近节点。它与节点
A
、
D
和
E
都有关系。算法将
A
到
B
的距离与
B
到每个节点的距离相加,计算出
A
到这些节点的距离。注意,从起始节点
A
到当前节点的最小代价始终作为沉没成本保留。距离(
d
)计算结果如下:
d(A,A) = d(A,B) + d(B,A) = 3 + 3 = 6
d(A,D) = d(A,B) + d(B,D) = 3 + 3 = 6
d(A,E) = d(A,B) + d(B,E) = 3 + 1 ...
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实战
Matt Fuller, Manfred Moser, Martin Traverso
数据库系统内幕
Alex Petrov
精實企業|高績效組織如何達成創新規模化
Jez Humble, Joanne Molesky, Barry O'Reilly
Publisher Resources
ISBN: 9787115546678