You are given an undirected weighted graph of `n` nodes (0-indexed), represented by an edge list where `edges[i] = [a, b]` is an undirected edge connecting the nodes `a` and `b` with a probability of success of traversing that edge `succProb[i]`. Given two nodes `start_node` and `end_node`, find the path with the maximum probability of success to go from `start_node` to `end_node` and return its success probability. If there is no path from `start_node` to `end_node`, return 0.
You are given an undirected weighted graph of n nodes (0-indexed), represented by an edge list where edges[i] = [a, b] is an undirected edge connecting the nodes a and b with a probability of success of traversing that edge succProb[i]. Given two nodes start_node and end_node, find the path with the maximum probability of success to go from start_node to end_node and return its success probability. If there is no path from start_node to end_node, return 0.
Every node starts at probability 0 except the start node 0, which starts at 1. Put (1, 0) in a max-heap so the most likely node is always handled next.
route
0 → 2
popped
-
best[2]
0
settled
0/3
0.50.50.2011020
numbers outside = best probability so fargreen = settled