Network formation as a choice process