In this paper, a heuristic algorithm in forming Bluetooth mesh topology is presented. The algorithm forming the scatternet includes two stages. In the first stage, a root node begins to create a conventional tree-shaped topology. In the second stage, a ba