New update is available. Click here to update.

Last Updated: 26 Mar, 2021

Difficulty: Moderate

```
The first line of input contains an integer 'T', the number
of test cases.
The first line of the test case contains four integers ‘N’,
‘M’, 'START', 'END' denoting the number of vertices, edges, starting vertex, and ending vertex.
The next ‘M’ lines describe the edge. Each edge is
characterized by two integers ‘A’ and ‘B’ where ‘A’ and ‘B’ denotes the endpoints of the edge.
The last line of each test case contains ‘M’ space-separated floating-point number denoting the probability of traversing ith edge.
The edges[i][0], edges[i][1] contains the vertex that is
connected to the edge.
```

```
Return the maximum probability of path from start to end vertex up to 6 decimal places. If there is no path, return 0.
```

```
Graph does not contain self-loops.
```

```
1 <= T <= 10
1 <= N <= 5 * 10 ^ 4
1 <= M <= min((N * (N - 1) / 2),10^5)
0 <= VERTEX VALUE, START, END <= N - 1
0 <= sProability[i] <= 1
Time Limit: 1 second
```

SIMILAR PROBLEMS

COUNT ISLANDS

Posted: 14 Sep, 2022

Difficulty: Moderate

Capturing Grid

Posted: 14 Sep, 2022

Difficulty: Moderate

Rotting Oranges

Posted: 15 Sep, 2022

Difficulty: Moderate

Distance to a Cycle in Undirected Graph

Posted: 7 Nov, 2022

Difficulty: Moderate

8-Queen Problem

Posted: 19 Dec, 2022

Difficulty: Easy

Popular Interview Problems: