Statistical Physics and Computation: Boltzmann-Gibbs distributions, factor models and Constraint Satisfaction Problems. Average complexity, ground states and sparse random graph ensembles. Locally tree-like graphs, Bethe-Peierls prediction and Belief Propagation equations.