During a disaster, emergency response operations can benefit from the establishment of a wireless ad hoc network. We propose the use of autonomous robots that move inside a disaster area and establish a network for two-way communication between trapped civilians with uncertain locations and an operation centre. Our aim is to maximise the number of civilians connected to the network. We present a distributed algorithm which involves clustering possible locations of civilians according to their expected shortfall; clustering facilitates both connectivity within groups of civilians and exploration that is based on the uncertainty of these locations. To achieve efficient allocation in terms of time and energy, we also develop a modified algorithm according to which the robots consider the graph that the cluster centres form and follow its minimum spanning tree. We conduct simulations and discuss the efficiency and appropriateness of the two algorithms in different situations. Categorie...