There is an undirected graph with values[i]. You are provided a edges, where edges[j] = [u_j, v_j, time_j] denotes an undirected edge between node maxTime.
A valid path is any sequence of nodes that begins at node maxTime. Nodes and edges may be visited multiple times. The quality of a path is defined as the sum of values[i] across all unique nodes visited along the path, meaning the value of each visited node is counted only once.
Return the maximum path quality among all valid paths.
Constraints:
n == values.length
values[i]
edges.length
edges[j].length
maxTime
All the pairs
There are at most
The graph may not be connected.
There is an undirected graph with values[i]. You are provided a edges, where edges[j] = [u_j, v_j, time_j] denotes an undirected edge between node maxTime.
A valid path is any sequence of nodes that begins at node maxTime. Nodes and edges may be visited multiple times. The quality of a path is defined as the sum of values[i] across all unique nodes visited along the path, meaning the value of each visited node is counted only once.
Return the maximum path quality among all valid paths.
Constraints:
n == values.length
values[i]
edges.length
edges[j].length
maxTime
All the pairs
There are at most
The graph may not be connected.