You are given an undirected, weighted, and connected graph with n nodes labeled from n edges where edges[i] = [u_i, v_i, w_i] represents an edge between node u_i and node v_i with a positive weight w_i.
You are also given three integers s, d, and k, representing the starting node, the destination node, and the maximum number of hops you can make, respectively. In a single hop, you can traverse an edge and set its weight contribution to
Return the minimum total weight of a path from s to d after reducing the weight of at most k traversed edges to
Constraints:
n
n edges.length
edges[i].length
edges[i][0], edges[i][1] n
edges[i][2]
s, d, k n
s d
The graph is connected and contains no repeated edges or self loops.
You are given an undirected, weighted, and connected graph with n nodes labeled from n edges where edges[i] = [u_i, v_i, w_i] represents an edge between node u_i and node v_i with a positive weight w_i.
You are also given three integers s, d, and k, representing the starting node, the destination node, and the maximum number of hops you can make, respectively. In a single hop, you can traverse an edge and set its weight contribution to
Return the minimum total weight of a path from s to d after reducing the weight of at most k traversed edges to
Constraints:
n
n edges.length
edges[i].length
edges[i][0], edges[i][1] n
edges[i][2]
s, d, k n
s d
The graph is connected and contains no repeated edges or self loops.