TypeVote algorithm : theory, computation, extensions and applications