I'm looking for an algorithm or framework for thinking about how to determine affinities between nodes. Perhaps affinity is poor choice of wording, but basically I want to use utilities between nodes to determine how alike or unalike they are from each other. I've attached an example diagram to illustrate what I mean:
In this example, Entities A and B are not well-aligned due to the negative utility between them. An appropriate algorithm or framework should identify that they belong to different groups, clusters, etc.
Additionally, I should be able to infer that Entities B and C are likely to be well-aligned, due to the mutual misalignment with A.
The utility magnitudes should also reflect the degree of alignment or misalignment. For example A2 and B3 should more more misaligned than A1 and B3.
To complicate things further, the utility "units" may be different, with multiple edges between nodes. As a simplifying assumption, I may be able to normalize utilities into a single edge and unit.
I apologize if this question is vague and/or ill-suited for this StackExchange. However I really don't have a good lead on how to tackle such a problem.