Weighted edges More general:each edge has a non-negative length. aA length function l(x,y)is given. l(path)=sum of lengths of edges on path l(s,t)=min l(path)over all paths from s to t Question:How to do now? Let's try BFS first. 24Weighted edges ◼ More general: each edge has a non-negative length. ❑ A length function 𝑙(𝑥, 𝑦) is given. ◼ 𝑙 𝑝𝑎𝑡ℎ = sum of lengths of edges on 𝑝𝑎𝑡ℎ ◼ 𝑙 𝑠,𝑡 = min 𝑙(𝑝𝑎𝑡ℎ) over all 𝑝𝑎𝑡ℎ𝑠 from 𝑠 to 𝑡 ◼ Question: How to do now? ◼ Let’s try BFS first. 24