Transforms a graph into a corresponding line graph.