Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Hub Labeling による高速経路探索
Search
NearMeの技術発表資料です
PRO
June 06, 2025
0
170
Hub Labeling による高速経路探索
NearMeの技術発表資料です
PRO
June 06, 2025
Tweet
Share
More Decks by NearMeの技術発表資料です
See All by NearMeの技術発表資料です
Tile38 Overview
nearme_tech
PRO
0
28
Rust 製のコードエディタ “Zed” を使ってみた
nearme_tech
PRO
0
170
実践で使えるtorchのテンソル演算
nearme_tech
PRO
0
20
ローカルLLMを⽤いてコード補完を⾏う VSCode拡張機能を作ってみた
nearme_tech
PRO
0
430
初めてのmarimo (ハンズオン)
nearme_tech
PRO
0
33
ローカルLLM
nearme_tech
PRO
0
54
LlamaIndex Workflow: Build Practical AI Agents Fast
nearme_tech
PRO
0
32
Box-Muller法
nearme_tech
PRO
1
54
Kiro触ってみた
nearme_tech
PRO
0
400
Featured
See All Featured
Embracing the Ebb and Flow
colly
88
5k
Faster Mobile Websites
deanohume
310
31k
DevOps and Value Stream Thinking: Enabling flow, efficiency and business value
helenjbeal
1
94
Neural Spatial Audio Processing for Sound Field Analysis and Control
skoyamalab
0
170
Efficient Content Optimization with Google Search Console & Apps Script
katarinadahlin
PRO
0
320
Rails Girls Zürich Keynote
gr2m
96
14k
How to Think Like a Performance Engineer
csswizardry
28
2.4k
Hiding What from Whom? A Critical Review of the History of Programming languages for Music
tomoyanonymous
2
420
How to optimise 3,500 product descriptions for ecommerce in one day using ChatGPT
katarinadahlin
PRO
0
3.4k
Learning to Love Humans: Emotional Interface Design
aarron
275
41k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
10
1.1k
Information Architects: The Missing Link in Design Systems
soysaucechin
0
770
Transcript
Hub Labeling による⾼速経路探索 2025-06-06 第123回NearMe技術勉強会 Shunma Serizawa
⽬次 1. 最短経路問題とは? 2. Hub Labeling の概要と利点 3. Hub Labeling
の仕組み 4. 実装と⽐較
1. 最短経路問題とは? • 最短経路問題とは? →ある場所から、他のある場所へ⾏くとき、最も移動距離 (時間) の 短いものを⾒つける • 有名なアルゴリズム
- ベルマンフォード法 - ダイクストラ法
2. Hub Labeling の概要と利点 • Hub Labeling とは? →最短経路クエリを⾼速に処理するための事前計算ベースの アルゴリズム
- 各頂点に対して、「ラベル」という情報を保持 - ラベルには、ある共通の「中継点(hub)」とその距離を記録 - クエリ時は、出発点と到着点のラベルを⽐較し、共通の hub を通 る経路の中で最短のものを選ぶ
2. Hub Labeling の概要と利点 • Hub Labeling の利点 - クエリ時間が⾮常に短い
- ハブ情報に経路中継情報を持たせると、経路を復元できる - 道路ネットワークのような疎なグラフが得意 • Hub Labeling の⽋点 - 前処理が重い - 動的グラフへの適⽤が困難
3. Hub Labeling の仕組み A B C D E F
G 1 2 2 3 2 2 1 3 2
3. Hub Labeling の仕組み A B C D E F
G 1 2 2 3 2 2 1 3 2 ラベリング A: (B, 1), (C, 2), (E, 3) B: (A, 1), (E, 2), (F, 3) C: (A, 2), (D, 2), (E, 2) D: (C, 3), (F, 2) E: (B, 2), (C, 2), (F, 1) F: (E, 1), (G, 2) G: (E, 3), (F, 2)
3. Hub Labeling の仕組み A B C D E F
G 1 2 2 3 2 2 1 3 2 ラベリング A: (B, 1), (C, 2), (E, 3) B: (A, 1), (E, 2), (F, 3) C: (A, 2), (D, 2), (E, 2) D: (C, 3), (F, 2) E: (B, 2), (C, 2), (F, 1) F: (E, 1), (G, 2) G: (E, 3), (F, 2)
3. Hub Labeling の仕組み A B C D E F
G 1 2 2 3 2 2 1 3 2 ラベリング A: (B, 1), (C, 2), (E, 3) B: (A, 1), (E, 2), (F, 3) C: (A, 2), (D, 2), (E, 2) D: (C, 3), (F, 2) E: (B, 2), (C, 2), (F, 1) F: (E, 1), (G, 2) G: (E, 3), (F, 2)
3. Hub Labeling の仕組み • Hub 数は性能に直結! - 各ノードのラベルに含まれるハブ数が少ないほど、クエリは⾼速 -
上⼿く設計すれば、数千万ノードでもノードあたりの平均ハブ数 は数⼗程度に • 上⼿く設計するには? - Contraction Hierarchies - Pruned Highway Labeling
4. 実装と⽐較 • データ - 東京駅を中⼼とした、⼀辺が 10 km の正⽅形内の道路情報 -
道路を無向辺、交差点を頂点 - 頂点数が 27247 、辺の数が 73624 • ⽐較⽅法 - ランダムな頂点対 1000 組の最短距離を取得 これくらい→
4. 実装と⽐較 前計算 クエリ Dijkstra - 50 ms Hub Labeling
3 時間くらい 0.5 ms
参考⽂献 • Route Planning in Transportation Networks ◦ https://arxiv.org/pdf/1504.05140 •
A Hub-Based Labeling Algorithm for Shortest Paths on Road Networks ◦ https://www.microsoft.com/en-us/research/wp-content/ uploads/2010/12/HL-TR.pdf
Thank you