Nowadays, with the increasing variety of computer systems, resource discovery in the Grid environment has been very important due to their applications; thus, offering optimal and dynamic algorithms for discovering resources in which users need a short period is an important task in grid environments.One of the methods used in resource discovery in grid is to use routing tables RDV (resource distance vector) in which the resources are based on certain criteria clustering and the clusters form a graph. In this way, some information about the resources is stored in RDV tables. Due to the environmental cycle in the graph, there are some problems; for example there are multiple paths to resources, most of which are repeated. Also, in large environments, due to the existence of many neighbors, updating the graph is time-consuming. In this paper, the structure of RDV was presented as a binary tree and these two methods (RDV graph-algorithm and RDVBT) were compared. Simulation results showed that, as a result of converting the structure to a binary tree, much better results were obtained for routing time, table updating time and number of successful requests; also the number of unsuccessful requests was reduced.