Applications of Random Graphs to Design and Analysis of LDPC Codes and Sensor Networks