2 posts
• Page **1** of **1**

In the editorial it says this problem could be solved by bfs.but this is a weighted graph.how do i implement bfs to find the distance between two nodes in a weighted graph.i knew that bfs can not be implement in a weighted graph.

**Posts:**2**Joined:**Wed Jan 17, 2018 3:20 pm

"but this is a weighted graph"

There is a weighted tree! So it is possible.

But i see no need in such algorithms. Single beforehand calculated matrix dist[5][5] can be useful.

There is a weighted tree! So it is possible.

But i see no need in such algorithms. Single beforehand calculated matrix dist[5][5] can be useful.

**Posts:**11**Joined:**Thu Jun 15, 2017 3:37 pm

2 posts
• Page **1** of **1**

Who is online

Users browsing this forum: No registered users and 1 guest