If you convert a tree from a graph. then you may have to cut some of the edge of the graph. So, after converting tree, you may not back to the graph. For converting the tree, you can use BFS or DFS or minimum spaning tree or Kruskal or primes. Some links that you can see or you can search it in google.
Click