TITLE: the conditions are not sufficient to ensure that the map $d:X\times X \to\mathbb{R}$ is a metric on the set $X$
QUESTION [5 upvotes]: Show that the conditions:   
(i) $d(x,y)=0$ iff $x=y(x,y\in X)$ and
(ii) $d(x,z)\le d(x,y)+ d(y,z), \forall x,y,z\in X$   
are not sufficient to ensure that the map $d:X\times X \to\mathbb{R}$ is a metric on the set $X$

Can someone provide me the answer please.I am completely stuk onit.

REPLY [2 votes]: A more natural example: Let $\Gamma$ be a finite weighted oriented multigraph. If $x, y\in \Gamma$ are two vertices, we may define $d(x,y)$ as the length of the shortest oriented path between $x$ and $y$. 

If all weight is positive then $d(x,y)=0$ iff $x=y$.
$d(x,y) \leq d(x,z)+d(z,y)$ for all vertices $x,y,z \in \Gamma$.
If $e,f$ are two edges of different weights between two vertices $x,y \in \Gamma$, $d(x,y) \neq d(y,x)$.

For example, such graphs can be used to classify hiking trails with respect to their difficulties. (And clearly, it is easier to go down a hill rather than to climb it, so the "distance" is not symmetric.)