Communication systems have been progressed tremendously in the past two decades. A large part of this success can be attributed to the discovery of various new algorithms in the wireless sensor networks. This paper proposes three new algorithms for routing by modifying the existing algorithm known as A-star algorithm to find the optimal path between the source and the destination nodes. This paper places a special emphasis on reducing the path length between the source and destination nodes which in turn reduce the execution time as well as the resource spent in finding the optimal path between the source and the destination node. The new algorithms proposed are named as diagonal A-star (DA*) which gives the diagonal path search ability to the existing A-star (A*) algorithm, bidirectional A-star (BIDA*) which gives the ability of traversing from both source and destination nodes at the same time hence reduces the execution time and the third algorithm known as diagonal-bidirectional combined which combines the ability of both; the above newly proposed algorithms propose a more optimized routing solution between the source and destination nodes. © 2021, Springer Nature Singapore Pte Ltd.