Graph_Algo - snir1551/Ex0_OOP GitHub Wiki

class Graph_Algo is implements from interface graph_algorithm

functions of class Graph_Algo:

  • init(graph g)

      this method initializes the graph.
    
  • copy()

      return a deep copy of this graph.
    
  • isConnected() // O(|V| + |E|) + O(n)

      return true if and only if there is a valid path from EVREY node to each
    
  • shortestPathDist(int src, int dest)

      returns the length of the shortest path between src to dest
    
  • shortestPath(int src, int dest)

      returns the the shortest path between src to dest - as an ordered List of nodes: src--> n1-->n2-->...dest
    
  • BFS(node_data n) //O(|V| + |E|)

      this method is our algorithm BFS that mark all the nodes he went through and there and keep for each node what is the shortest distance.
      return map that contains the fathers(path to the dest node)