Wireless sensor networks (WSNs) is an area of research that has been getting a lot of attention lately. This is due to the rapid advancements in the design of wireless devices which have increasingly more processing, storage, memory, and networking capabilities. In addition, the cost of sensors is constantly decreasing making it possible to use large quantities of these sensors in a wide variety of important applications in environmental, military, commercial, health care, and other fields. In order to monitor certain types of infrastructures, many of these applications involve lining up the sensors in a linear form, making a special class of these networks which are defined in this work as Linear Sensor Networks (LSNs). In a previous paper, we introduced the concept of LSNs along with a classification of the different types of LSNs, a sample of their applications and the motivation for designing specialized protocols that take advantage of the linearity of the network to enhance their communication efficiency, reliability, fault tolerance, energy savings, and network lifetime. This paper presents a graph-search-based topology discovery algorithm for LSNs. New definitions for important structure and design parameters are introduced. The proposed protocol allows the nodes to identify some nodes to be included in a backbone, which can be used by the other nodes to send data to the sink at the end of the LSN or LSN segment. This backbone discovery increases the efficiency, and robustness of the network. It also allows for significant improvement in the scalability of the communication process in the LSN which can contain a very large number of nodes (e.g. Hundreds or thousands). In addition, the linearity of the structure and the discovered backbone can enhance the routing reliability by "jumping" over failed nodes by increasing the range. Furthermore, the protocol does not require the nodes to have location detection capabilities such as GPS, which would lead to a more complex design and higher cost of the sensor nodes.