We propose a model of emergence of cooperation in evolutionary games that high- lights the role of network formation and effect of network structure. In line with empirical data, the model proposes a mechanism that explains the persistence of heterogeneous types (heterogeneity in rules for changing behavior) within a population, and in particular the sustainability of altruism (presence of unconditional cooperators) even in case of strong social dilemma. This explanation constitutes an alternative to the choice and refusal mechanism that is often presented as an explanation for cooperation on dynamic networks. We also exhibit a minimal set of strategies for emergence of cooperation (altruists, reciprocators and selfish agents) and sketch a two steps scenario for this emergence. We adopt an hybrid methodology with both analytical and computational insights.