This paper presents an efficient time slot assignment algorithm for a wireless sensor and actor network (WSAN), which consists of stationary sensors for detecting events and mobile actors for performing tasks. TDMA protocols are suitable for WSAN due to time-critical tasks, which are assigned to actors. In order to improve the performance of TDMA protocol, a time slot assignment algorithm should generate not only efficient TDMA scheduling but also reduce periodic run-time overhead. The proposed algorithm offers 0(delta(2)) run-time in the worst case, where delta is the maximum number of one-hop and two-hop neighbors in the network. The average run-time in simulation results is far less than 0(delta(2)), however, while the maximum number of assigned slots is bounded by 0(delta). In order to reduce the run-time further, we introduce two fundamental processes in the distributed slot assignment and design the algorithm to optimize these processes. We also present an analysis and verify it using ns-2 simulations. Although the algorithm requires time synchronization and prior knowledge of two-hop neighbors, simulation results show that it reduces the run-time significantly and has good scalability in dense networks.