Showing posts with label Graph Theory. Show all posts
Showing posts with label Graph Theory. Show all posts

Wednesday 22 November 2017

বেলম্যান ফোর্ড(Bellman-Ford) অ্যালগরিদমঃ

Bellman-Ford algorithm solves the single shortest path problem like BFS and Dijkstra. But if the input graph has negative edge weights, Dijkstra fails.

Motivating Problem: Given a weighted, directed Graph G with source s and weight w, the Bellman-Ford algorithm returns a boolean value whether or not there is a

Sunday 19 November 2017

ডায়াক্সট্রা(Dijkstra):

Dijkstra is a shortest path finding algorithm like BFS. BFS works only when the graph is unweighted.But if the graph is weighted, BFS doesn't work correctly. If the edges of a graph is non-negative and weighted, shortest path of the graph can be found by Dijkstra algorithm.

Motivating Problem:Given a weighted graph G and a starting source vertex s,what are the shortest paths from s to the other vertices of G?