Back to course home
0% completed
Vote For New Content
Solution: Path with Maximum Probability
Problem Statement
You are given an undirected graph with n
nodes labeled from 0
to n-1
. The graph is described using an edge
list, where each edge connects two nodes a
and b
with a probability of success of traversing that edge succProb[i]
.
Given two nodes start
and end
, find the path with the maximum probability
of success to go from start
to end
and return its success probability
.
The result should be accurate within a margin of 1e<sup>-5</sup>.
Examples
Example 1:
- Input:
- n = 5
.....
.....
.....
Like the course? Get enrolled and start learning!
On this page