In wireless sensor networks, there exist many redundant sensor nodes, and activating only the necessary number of sensor nodes at any particular moment can save energy, while ensuring all targets covered and network connectivity. In this paper, we first introduce a distributed scheme for sink nodes to find K paths to each sensor nodes. Secondly, a shortestpath-based algorithm is presented for the maximum set covers problem in wireless sensor networks. The algorithm partitions all nodes into possibly maximum disjointed sets, and the nodes in each set have all targets covered while ensuring the network connectivity. In the proposed algorithm, when constructing a cover set, the key idea is to select a node joining into the set if it has the shortest path to the nodes which is already in the set. At last, simulation is done, and the result shows that the proposed algorithm outperforms others.