Sensor-network technology is indispensable for constructing ubiquitous network infrastructures. Although information about adjacent relations between sensors is also very important for sensor networks, obtaining this information automatically without manual assistance is extremely difficult. Consequently, we propose a new methodology for constructing adjacent relations in sensor networks using an ant-colony optimization algorithm. This methodology can be used to automatically extract adjacent relations without using prepared sensor-location information or RFIDs to identify individual humans. We implemented a prototype system, and verified its basic effectiveness through simulations and an experiment using real data.