Learn how to a build a cloud-first strategyRegister Now

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

graphs

what requirement will you need in order to decide which algorithm  to use.
0
elrayiss
Asked:
elrayiss
  • 3
1 Solution
 
javaexpertoCommented:
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
 
elrayissAuthor Commented:
yea that and the sorting algorithms depth and breadth and what are the requirements to decide which to use. thank you
0
 
javaexpertoCommented:
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
 
javaexpertoCommented:
I forgot to tell you that Depth first and breadth first are not sorting algorithms, they are search algorithms.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

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