Oh My Algorithm
Algorithm Guidecomplexity: O(E)

A* 탐색 (A-Star Search)

f(n) = g(n) + h(n) 이 가장 작은 노드를 우선 확장하는 휴리스틱 기반 최단 경로 알고리즘입니다. 휴리스틱이 admissible 하면 최적 경로를 보장하며, 경로 탐색·게임 AI·로봇 내비게이션의 표준 도구입니다.

01 Explore How It Works

Interactive Step-by-Step
A* Search
13211Af=10 (g=0,h=10)Bh=8Ch=5Dh=3Gh=0

A* 탐색 시작. f(n)=g(n)+h(n)이 가장 작은 노드부터 확장하며, 휴리스틱이 실제 비용을 넘지 않으면 최적 경로를 보장합니다.

Logic Node1 / 10

02 Understand It Simply

For Everyone
🔑Analogy

목적지 방향을 어림짐작해 그쪽으로 가까운 길부터 우선 살피는 내비게이션.

💡In Plain Words

실제 비용 g와 목적지까지의 추정 h를 더한 f가 작은 노드부터 확장합니다.

좋은 추정이면 다익스트라보다 빨라요.

📍Where It's Used
  • 게임 길찾기
  • 로봇 내비게이션
  • 경로 탐색

03 Python Implementation

A clean, readable reference implementation of the core logic of A* 탐색 (A-Star Search).

core_implementation.py
from heapq import heappush, heappop

def a_star(graph, start, goal, h):
    open_set = [(h[start], start)]
    g = {start: 0}
    parent = {start: None}
    closed = set()
    while open_set:
        f_cur, current = heappop(open_set)
        if current == goal:
            return reconstruct(parent, goal)
        closed.add(current)
        for nb, w in graph[current]:
            if nb in closed:
                continue
            tentative = g[current] + w
            if tentative < g.get(nb, float("inf")):
                g[nb] = tentative
                parent[nb] = current
                heappush(open_set,
                         (tentative + h[nb], nb))
    return None

04 Frequently Asked Questions

FAQ
What is A* 탐색 (A-Star Search)?+

f(n) = g(n) + h(n) 이 가장 작은 노드를 우선 확장하는 휴리스틱 기반 최단 경로 알고리즘입니다. 휴리스틱이 admissible 하면 최적 경로를 보장하며, 경로 탐색·게임 AI·로봇 내비게이션의 표준 도구입니다.

What is the time complexity of A* 탐색 (A-Star Search)?+

The time complexity of A* 탐색 (A-Star Search) is O(E). Follow the step-by-step visualization to see exactly why.

Where is A* 탐색 (A-Star Search) used?+

게임 길찾기, 로봇 내비게이션, 경로 탐색.

What's a simple analogy for A* 탐색 (A-Star Search)?+

목적지 방향을 어림짐작해 그쪽으로 가까운 길부터 우선 살피는 내비게이션.

Guide Progress0%