When an infectious disease spreads in a community two characteristics affect the dynamics: the disease agent and its transmissability, and the social structure in the community. Usually neither of these characteristics are fully known, why stochastic models are useful. The social structure may be modeled using random graphs/networks incorporating known structures of the community, such as degree distribution (the number of friends) and/or clustering (the presence of social triangles). The disease outbreak is modeled by randomly thinning edges in the graph, and vaccination prior to the outbreak by thinning of nodes in the graph. In the talk we illustrate these methods with some examples and also apply them to data.