Computational principles of collective action problems