Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Hub Labeling による高速経路探索
Search
NearMeの技術発表資料です
PRO
June 06, 2025
920
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Hub Labeling による高速経路探索
NearMeの技術発表資料です
PRO
June 06, 2025
More Decks by NearMeの技術発表資料です
See All by NearMeの技術発表資料です
AIエージェントのための 隔離された安全なインフラ設計
nearme_tech
PRO
0
23
Claude Code × git worktree で並列開発 (続き) -差分のサービスだけを併設する-
nearme_tech
PRO
1
69
Claude Code × git worktree で並列開発 — サブモジュール構成のリポジトリで成立させる —
nearme_tech
PRO
0
79
LLM + 強化学習
nearme_tech
PRO
0
37
PosthogのA/Bテスト機能の紹介
nearme_tech
PRO
1
110
AIフレンドリーなプロダクトに向けて
nearme_tech
PRO
2
71
初めてのLean言語
nearme_tech
PRO
0
110
Apache Airflow Workflow orchestration without turning cron into spaghetti
nearme_tech
PRO
2
50
実務で役立つ幾何学 ボロノイ図の基礎から グラフ・ネットワーク応用まで
nearme_tech
PRO
1
93
Featured
See All Featured
The Impact of AI in SEO - AI Overviews June 2024 Edition
aleyda
6
1.2k
Bioeconomy Workshop: Dr. Julius Ecuru, Opportunities for a Bioeconomy in West Africa
akademiya2063
PRO
1
410
Speed Design
sergeychernyshev
33
2.2k
SEOcharity - Dark patterns in SEO and UX: How to avoid them and build a more ethical web
sarafernandez
0
300
Marketing Yourself as an Engineer | Alaka | Gurzu
gurzu
0
330
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
18k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
21
1.7k
Design in an AI World
tapps
1
350
RailsConf 2023
tenderlove
30
1.6k
The Hidden Cost of Media on the Web [PixelPalooza 2025]
tammyeverts
2
530
How to make the Groovebox
asonas
2
2.5k
KATA
mclloyd
PRO
35
16k
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