Network Delay Time
Problem Statement
There are
network nodes, and they are labeled from
to
. You are given the following information:
- A list of edges, where each edge is described by an array of three integers
[source, destination, weight]
. These edges represent the connections between the network nodes.
- You are also given an array of length , where represents the time taken to traverse from node to all other nodes.
You need to calculate the minimum time it takes for all nodes to receive information. If the network is disconnected, return
.
Rules and Constraints
- The graph is represented as an adjacency list where each node has a weight (time) associated with it.
- The weight (time) associated with an edge is considered to be the weight of the edge instead of the edge's capacity.
- The input graph may contain self-loops and multiple edges between the same pair of nodes, but the weight will only be considered once.
- You must consider that the weight of the edges may not be symmetric.
- The network nodes are numbered from to .
Complexity Constraints
- The time complexity of your solution should be in the worst case.
Example
Input: {"input_data":[1,2,3]}
Output: [1,2,3]