In this paper, we present a novel definition of connectivity for ad hoc networks, and based on this definition, we propose a scheduling algorithm that can optimize the connectivity of the network through scheduling the active links into different time slots. We also propose an adaptive beamforming algorithm that reduces the impact of the co-channel interference on the links that transmit simultaneously. Simulation results demonstrate that the choice of the number of time slots is critical in optimizing the connectivity of the network.