A metric on non negative symmetric matrix

168 Views Asked by At

Let $w=\{w(i,j)\}_{1\le i,j\le m}$ be an $m\times m$ symmetric matrix with non-negative real entries such that $w(i,j)=0$ iff $i=j$. Show that $$d(i,j)=\min\left\{\sum_{j=0}^{k-1}w(i_j,i_{j+1}):k\ge1,i_0=i,i_k=j,i_j\in\{1,\ldots,m\}\right\}$$ is metric on $\{1,\ldots,m\}$.

Please help me with triangle inequality : I thought this: $$d(i,j)=(\text{minimum of all the elements among } i\text{-th row except }(i,i) \text{-entry } 0)+(\text{minimum of all the elements among }j\text{-th column except }(j,j) \text{-entry }0).$$ From this observation, triangle inequality is obvious. Am I correct?

Also, the hypothesis 'symmetric matrix' is used only to prove $d(i,j)=d(j,i)$, right?

1

There are 1 best solutions below

2
On BEST ANSWER

No, your reasoning is not correct, as you're not just involving the elements of the $i$-th row and $j$-th column; that describes just taking an intermediate "node" to the objective.

Take the following example:

$$ A = \begin{pmatrix} 0 & 1 & 4 & 8 \\ 1 & 0 & 1 & 4 \\ 4 & 1 & 0 & 1 \\ 8 & 4 & 1 & 0 \end{pmatrix} $$

Then $d(1,4) = w(1,2) + w(2,3) + w(3,4) = 1 + 1 + 1 = 3 $.

An intuitive way to look at this is by means of a graph. The entries of the matrix $w$ correspond to the cost of moving from one node to another, and the described distance correspond to the shortest possible path.

In the given example, this correspond to the following move, each step costing 1 $$ 1 \rightarrow 2 \rightarrow 3 \rightarrow 4 $$

adding up to the value of 3.

Once you understood that it correspond to a shortest path, it is intuitive that it must satisfy the triangular inequality as "moving optimally from node $i$ to node $j$ should be shorter than forcing the path to go through any other node $k$" i.e. $d(i,j) \leq d(i,k) + d(k,j)$.

To prove it, use this intuition. Fix $i,j,k$ nodes. Take the optimal path from $i$ to $k$, that is, take the intermediate nodes $a_1,\ldots,a_n \in \{1,\ldots,m\}$ such that $$d(i,k) = w(i,a_1) + w(a_1,a_2) + \ldots + w(a_n, k),$$ or, intuitively $$ i \rightarrow a_1 \rightarrow a_2 \rightarrow \ldots \rightarrow a_n \rightarrow k.$$ We do the same for the optimal path between $k$ and $j$. Take the intermediate nodes $b_1,\ldots ,b_l \in \{1,\ldots, m\}$ such that $$d(k,j) = w(k,b_1) + w(b_1,b_2) + \ldots + w(b_l, j),$$ i.e. $$ k \rightarrow b_1 \rightarrow b_2 \rightarrow \ldots \rightarrow b_l \rightarrow j.$$

So, we can join these two paths and get from $i$ to $j$, i.e. $$ i \rightarrow a_1 \rightarrow \ldots \rightarrow a_n \rightarrow k \rightarrow b_1 \rightarrow \ldots \rightarrow b_l \rightarrow j$$

This path is a particular path between $i$ and $j$, but not necessarily optimal, therefore, since $d(i,j)$ is defined as the minimum of all possible paths between $i$ and $j$, we see that $$ d(i,j) \leq w(i,a_1) + w(a_1,a_2) + \ldots + w(a_n,k) + w(k,b_1) + \ldots + w_(b_l,j) = d(i,k) + d(k,j). $$

'Symmetric matrix' is used only to prove $d(i,j) = d(j,i)$

Yes, furthermore, positivity is required for this distance to be finite, else, if some step is negative, it is always better to bounce between the nodes with negative cost, driving the cost to $- \infty$.