An ideal routing algorithm is one which finds the best/shortest path(s) for transmitting the data between source and destination in a short time. In this study, we have proposed two approaches; one is based on minimum spanning tree (MST) and the other one is based on distance vector method (DVM). For MST, a genetic algorithm is used. The chromosomes used are of variable length and their genes are used for encoding. The crossover and mutation operations are used for genetic diversity and improving the convergence rate. The second method is based on DVM to cover the limitations of the first approach as well the traditional DVM. The developed algorithm finds the shortest path for a static mesh connected mobile nodes. It is then tested for dynamicity by varying the positions of a few nodes. Extensive simulations are carried out on both the approaches and the results are compared with other popular algorithms. © 2018 Inderscience Enterprises Ltd.