# Non-commutative distance formula

I am trying to find a distance formula or a method that can give the non-commutative distance between two points in a feature space.

Suppose there are two movies represented in an R^n feature space. Now I want that when I try to find the distance/similarity between these movies using the feature vectors, I get different values with respect to which movie is the reference point i.e.,

Dist(Mov1, Mov2) != Dist(Mov2, Mov1)


I know this is slightly vague, but I am trying to understand my thoughts and would like your help. I found that there is a field called non-commutative geometry, but that seems a little too much and the last resort to dive into. Kindly direct my thoughts.

• What other properties would you want your distance to have? Without more information, we're unlikely to help you much. Here's a thought anyway - for directed graphs, a sensible distance between two points is the shortest path along directed edges. This can easily not be commutative depending on the particulars of the graph. Apr 7, 2021 at 18:36
• The Kullback-Leibler divergence is a non-symmetric (this is the term you should use instead of 'non-commutative') function that is intuitively thought of a distance. It's a function on probability distributions, not points, but still might be of interest to and helpful for you as it shows that sometimes there are important reasons to have a non-symmetric 'distance'. Jun 7, 2021 at 19:18

Take for example the Euclidean distance L2, defined by: $$L_2(x,y) = \left(\sum_{i=1}^{d} (x_i-y_i)^2\right)^{1/2}$$ where $$d$$ is the vector dimension. You can easily add a term $$\alpha \in (0,1)$$ and put more weight on the first term, for example: $$L_2(x,y) = \left(\sum_{i=1}^{d} (\alpha x_i-(1-\alpha)y_i)^2\right)^{1/2}$$ That will certainly be non-cummutative and basically it can be interpreted as putting more weight on the 'reference' vector.