Inhomogeneous Models for Random Graphs and Spreading Processes: Applications in Wireless Sensor Networks and Social Networks