Graph theory complete multiparite graph 
Let $G$ be a nonempty graph with the property that whenever $uv\notin E(G)$ and $vw \notin E(G)$ then $uw \notin E(G)$ .Prove that $G$ is a complete multipartite  graph.

I am not sure what to do. I know the definition of complete multipartite  means mean a graph in which there is an edge between every pair of vertices of independent sets.
So this means if $u$ and $v$ are not adjacent, then they are in the same set. $v$ and $w$ are not adjacent because they are in the same set, and $w$ and $u$ are not adjacent because they are in the same set. So I think this means that $u,$ $v$ and $w$ are all in the same independent set and not adjacent. But I am not sure how to do a proof.
 A: One way to think about it is in terms of the complement graph of $G$.  The stated condition tells us the connected components of $G^c$ are cliques (because of the transitivity of non-adjacency in $G$).
In any case, for each vertex $u$ in $G$, consider the part $P(u)$ consisting of all vertices non-adjacent to $u$.  Then these parts partition the vertices of $G$ because (under the stated hypothesis) being non-adjacent is an equivalence relation on the vertices.  [Note: In any simple graph a vertex is not adjacent to itself, giving the reflexive property of non-adjacency.  Symmetry of non-adjacency is left as an easy exercise.]
A: I'm a bit confused.  Doesn't this graph obey your conditions:


*

*$G$ is non-empty

*Whenever $uv \notin E(G)$ and $vw \notin E(G)$ then $uw \notin E(G)$ 


and yet is not a complete multipartite graph?

A: Consider the relation $\sim$ on $V$ defined as
\begin{align}
\forall(a,b\in V):a\sim b\iff ab\notin E
\end{align}
Our condition implies that $\sim$ is an equivalence relation.
Now, consider the quotient set $V/\sim$ and distinct classes $C,D\in V/\sim$.
First, we have $\forall(a,b\in C):ab\notin E$
Further, suppose $c\in C$ and $d\in D$.
If $cd\notin E$, then we have the contradiction $C=D$.
This proves that $G$ is a complete multipartite graph with the parts taken as classes of $V/\sim$.
