We formulate a generalized susceptible exposed infectious recovered (SEIR) model on a graph, describing the population dynamics of an open crowded place with an arbitrary topology. As a sample calculation, we discuss three simple cases, both analytically, and numerically, by means of a cellular automata simulation of the individual dynamics in the system. As a result, we provide the infection ratio in the system as a function of controllable parameters, which allows for quantifying how acting on the human behavior may effectively lower the disease spread throughout the system.