A research of lossless network compression is carried out. To meet the different needs, two approaches of lossless network compression are proposed in this research. One approach, judging importance of the nodes according to their roles playing in the community composition, quantifies the importance of every node in communities, and achieves lossless network compression through layers; another approach, judging importance of the nodes according to the distances from the community representative nodes to them, differentiates the nodes with different distances, and achieves lossless network compression through compression ratio. Comparative experiments show that the two approaches not only can achieve perfect compression ratio, and retain the relationship between the communities, but also can reserve the important nodes or basic community structures during the compression process according to the needs.