Abstract-Bluetooth is an enabling technology for Personal Area Networks. A scatternet is an ad hoc network created by interconnecting several Bluetooth piconets, each with at most eight devices. Each piconet uses a different radio channel constituted by a frequency hopping code. The way the devices are grouped in different piconets and the way the piconets are interconnected greatly affect the performance of the scatternet in terms of capacity, data transfer delay, and energy consumption. There is a need to develop distributed scatternet formation algorithms, which guarantee full connectivity of the devices, reconfigure the network due to mobility and failure of devices, and interconnect them such a way to create an optimal topology to achieve gainful performance. The contribution of this paper is to provide an integrated approach for scatternet formation and quality-of-service support (called SHAPER-OPT). To this aim, two main procedures are proposed. First, a new scatternet formation algorithm called self-healing algorithm producing multihop Bluetooth scatternets (SHAPER) is developed which forms tree-shaped scatternets. A procedure that produces a meshed topology applying a distributed scatternet optimization algorithm (DSOA) on the network built by SHAPER is then defined.Performance evaluation of the proposed algorithms, and of the accordingly created scatternets, is carried out by using ns2 simulation. Devices are shown to be able to join or leave the scatternet at any time, without compromising the long term connectivity. Delay for network setup and reconfiguration in dynamic environments is shown to be within acceptable bounds. DSOA is also shown to be easy to implement and to improve the overall network performance.Index Terms-Bluetooth, multihop ad hoc networks, scatternet formation, topology optimization.