In this paper, we focus to find desired node position in indoor environments using a sequence of observations and user movement records. For this purpose, we first record the user's movements in indoor environments by defining a set of states and several matrices, which are Viterbi inputs. In order to record the fingerprints of the environment, we move across the entire coordinates of the building to collect and record the fingerprints of different places. In online phase, we use the Weighted K-Nearest Neighbors (WKNN) algorithm in parallel to check the accuracy of both WKNN and Viterbi algorithms and to correct the WKNN behavior by Viterbi. During this phase, an experimental node is inserted into the environment and moves in the desired direction by determining the destination. The proposed method calculates the current location of the node and its most probable location in the next step. The results of the implementation and testing of the proposed algorithm in the Faculty of Engineering, Arak University, show the optimal performance of the proposed idea for predicting the location and path of the node.