Continued fractions and representations of graphs