题库chevron_right分类chevron_right最短路径
label

最短路径

29 道题目
简单: 0中等: 16困难: 13

最短路径 是技术面试里最常出现的能力维度之一。建议先掌握基础题型的边界处理,再逐步过渡到模式识别和复杂度 trade-off。

面试场景

高频考察问题建模、边界条件与口头表达的清晰度。

常见误区

只背模板不解释为什么,容易在追问里失分。

练习策略

每轮练 3-5 题,固定复盘复杂度和可替代解法。

推荐练习顺序

#题目难度
399

除法求值

Compute the results of division queries from given equations using graph traversal and depth-first search efficiently.

中等
743

网络延迟时间

Find the minimum time for a signal to travel to all nodes in a directed graph or determine if it's impossible.

中等
787

K 站中转内最便宜的航班

Find the cheapest flight from a source to a destination with at most K stops using graph traversal techniques efficientl…

中等
882

细分图中的可到达节点

The Reachable Nodes In Subdivided Graph problem requires efficiently finding the reachable nodes using graph traversal a…

困难
1334

阈值距离内邻居最少的城市

Find the city with the fewest neighbors within a given threshold distance using dynamic programming.

中等
1368

使网格图至少有一条有效路径的最小代价

Determine the minimum cost to create at least one valid path from the top-left to bottom-right in a directional grid.

困难
1514

概率最大的路径

Find the path with the highest success probability in a graph from a start node to an end node, using edge probabilities…

中等
1786

从第一个节点出发到最后一个节点的受限路径数

Solve the problem of finding the number of restricted paths in a weighted undirected graph, leveraging graph algorithms …

中等
1976

到达目的地的方案数

Find the number of ways to travel from intersection 0 to n - 1 in the shortest time, using a graph-based approach.

中等
2045

到达目的地的第二短时间

Find the second minimum time to reach a destination using BFS while accounting for traffic signal delays in a graph trav…

困难
2203

包含要求路径的最小带权子图

Find the minimum weighted subgraph that connects three specified nodes in a directed graph with constraints.

困难
2290

到达角落需要移除障碍物的最小数目

Find the minimum obstacles to remove in a 2D grid to reach the bottom-right corner using BFS graph traversal techniques.

困难
2577

在网格图中访问一个格子的最少时间

Compute the fastest path in a grid where each cell has a minimum time requirement using BFS and priority queue technique…

困难
2642

设计可以求最短路径的图类

Implement a dynamic weighted directed graph with efficient shortest path queries and edge additions in real time.

困难
2662

前往目标的最小代价

Find the minimum cost path between two points, using special roads or direct moves in a 2D space.

中等
2699

修改图中的边权

Modify Graph Edge Weights is a graph problem where you adjust edge weights to match a target shortest path distance.

困难
2959

关闭分部的可行集合数目

Calculate all valid sets of branch closures while keeping remaining branches within maxDistance using bitmask and graph …

困难
2976

转换字符串的最小成本 I

This problem asks to calculate the minimum cost to convert a string from source to target using specific character trans…

中等
2977

转换字符串的最小成本 II

Compute the minimum cost to transform source into target using substring replacements with given costs efficiently using…

困难
3112

访问消失节点的最少时间

Determine the minimum time to visit each node in a disappearing-node graph using arrays, graphs, and priority queues eff…

中等
3123

最短路径中的边

Use two Dijkstra runs to mark exactly which edges can appear on at least one shortest path from 0 to n - 1.

困难
3286

穿越网格图的安全路径

Determine if you can safely traverse a binary grid from top-left to bottom-right using limited health points.

中等
3341

到达最后一个房间的最少时间 I

Find Minimum Time to Reach Last Room I challenges you to determine the minimum time to travel in a dungeon with a grid l…

中等
3342

到达最后一个房间的最少时间 II

Calculate the minimum time to reach the last room in a grid with alternating move times using array and graph patterns.

中等
3377

使两个整数相等的数位操作

Transform n into m using allowed digit operations without creating primes, applying math and graph strategies efficientl…

中等
3419

图的最大边权的最小值

Minimize the maximum edge weight in a graph after removing certain edges while ensuring node reachability.

中等
3594

所有人渡河所需的最短时间

Find the minimum time to transport individuals across a river with dynamic environmental conditions and boat capacity.

困难
3604

有向图中到达终点的最少时间

The problem involves finding the minimum time to reach the destination in a directed graph with time-dependent edges.

中等
3620

恢复网络路径

Find the maximum recovery cost of valid paths in a directed acyclic graph where some nodes are offline.

困难

关联高频模式

LeetCode 最短路径题型题解:29题训练路线