Learn how to a build a cloud-first strategyRegister Now

x
• Status: Solved
• Priority: Medium
• Security: Public
• Views: 221

# graphs

what requirement will you need in order to decide which algorithm  to use.
0
elrayiss
• 3
1 Solution

Commented:
Are you talking about graphs algorithms?
It depends of you problem, for example if do you want to know all shortest paths from all nodes to all nodes, use the floyd's algorithm, but if you want to know only shortest path from one node to another use Dijkstra's algoritm.
0

Author Commented:
yea that and the sorting algorithms depth and breadth and what are the requirements to decide which to use. thank you
0

Commented:
Depth first and breadth first. Also it will depends of you problem, a breadth first algorithm does an exhaustive search of the graph, that is, ALWAYS find the path when it exist.  So if your "search space" is small you can try breadth first, because it use more memory, also if you know that there is a solution. Depth first search tends to require less memory. Depth first is good when there are many possible solutions and you only want one (may be not the shortest one).
There are many known problems that you use depth and others that you use breadh.
0

Commented:
I forgot to tell you that Depth first and breadth first are not sorting algorithms, they are search algorithms.
0

## Featured Post

• 3
Tackle projects and never again get stuck behind a technical roadblock.