In cloud computing, virtualised environments have led to a great deal of research into the possibilities and restrictions of using them, or consolidating resources. However, most of this research is limited to a level of performance analysis, which does not delve into the effects of competition between the various virtual environments, and how to mitigate these effects. The study presented in this paper proposes the concept of affinity, which defines the degree of coexistence between classes of applications. The elements that influence these combinations are: the classes and subclasses of algorithms used to implement these applications, associated with the types of parallel libraries they use. The results obtained in this research show that the effects of these combinations between classes of algorithms and parallelisation libraries have such diverse values that it is necessary to study and measure these values in detail, justifying the proposal presented here in terms of defining and analysing the affinity concept, with the aim of contributing to a better use of resources, especially with regard to massively parallel and distributed computing.