2

I want to getting the level of a graph, i know one that is get the shortest path between two nodes (Djikstra), What is the best on space and time ? regards

Rahul Bhobe
  • 4,165
  • 4
  • 17
  • 32
  • 1
    What do you mean by the level of a graph? – Display name Jun 12 '20 at 01:52
  • @Displayname normaly we use level of tree, i use level of graph to treat every kind of graph. – Hicham ATATRI Jun 12 '20 at 03:06
  • do you mean that given a source then you want to find the minimum number of edges one has to move over, to reach other nodes? – Display name Jun 12 '20 at 04:54
  • I think this one is the diameter, level is the number of parent nodes corresponding to a given a node of the tree. – Hicham ATATRI Jun 12 '20 at 07:47
  • @HichamATATRI If, for a given node, you want to find the length of the shortest path to the node that is farthest away from the given one, then it seems to me that for disconnected graphs you could just go ahead and return infinity, and for connected graphs you could just run a BFS and return the number of iterations needed to traverse the whole thing. – Patrick87 Jun 12 '20 at 12:25
  • 1
    @Patrick87 thanks, BFS thatis what i search. – Hicham ATATRI Jun 12 '20 at 16:42

0 Answers0