Breadth-first search (BFS) is an algorithm for searching a tree data structure for a node that satisfies a given property. It starts at the tree root and explores all nodes at the present depth prior to moving on to the nodes at the next depth level.
The Bellman-Ford algorithm is an example of Dynamic Programming. It starts with a starting vertex and calculates the distances of other vertices which can be reached by one edge. It then continues to find a path with two edges and so on. The Bellman-Ford algorithm follows the bottom-up approach.
1. Submitted By:
Md. Mejanur Rahman
Id: 183015125
Department Of CSE
Green University Of Bangladesh
Submitted To:
Jargis Ahmed
Lecture Dept. of CSE
Welcome To My Presentation
4. 4
Algorithm means “a process or set of rules to be followed in
calculations or other problem-solving operations”.
Introduction:
5. 5
Algorithm:
I read the number of edges while edges != 0.
Read the graph.
Read the node to search and the ttl while node !=0
and ttl != 0.
Call bfs(node) and init not Reach = 0.
Traverse all the calculated distance from node. If
(distance > ttl) notReach+1;
Traverse the visited map. If an node is not visited.
notReach+1.
Print not Reach.
6. 6
The nodes does not follow a correlative order.
Care full with the nodes that are not connected in the
bfs request.(check my case)
Hint of Solution:
10. 10
Bellman Ford Algorithm:
The Bellman-Ford algorithm is one of the classic solutions to this
problem. It calculates the shortest path to all nodes in the graph from
a single source.
12. 12
Bellman Ford Algorithm :
Start by considering that the shortest path to all nodes, less the source, is infinity.
Mark the length of the path to the source as 0
Take every edge and try to relax it
Relaxing an edge means checking to see if the path to the node the edge is
pointing to can’t be shortened, and if so, doing it. In the above graph, by checking
the edge 1 -> 2 of length 6, you find that the length of the shortest path to node
1 plus the length of the edge 1 -> 2 is less then infinity. So, you replace infinity
in node 2 with 6.
13. 13
Tricky Lines :
1.starting from our solar system, it is always possible to end up in any
star system by following a sequence of wormholes
2.Between any pair of star systems, there is at most one wormhole in
either direction.
17. 17
The basic idea of implementing curiosity and boredom is not limited to the
particular algorithm described in the first section. Every model-dependent
on-line algorithm for learning goal directed behavior might be augmented by
a similar implementation of `the desire to improve the world model'.
Concluding remark: