Abstract:UML class diagrams are helpful for understanding complicated object-oriented software systems. The reasonable placement of diagram elements can make class diagrams more readable and understandable. As inheritance is regarded as a hierarchical relation, the hierarchical layout method is usually adopted to draw UML class diagrams. Because the domain specific knowledge and drawing criteria related to class diagrams must be considered in the layout of diagrams, general hierarchical layout algorithms for nested digraphs should be extended according to these criteria. But existing hierarchical layout algorithms for class diagrams cannot handle the nested relations among packages, classes, and interfaces, and existing compound layout methods for digraphs cannot be used directly to draw class diagrams. Layout criteria are selected based on the knowledge of graph drawing aesthetics, UML class diagram semantics and software visualization. In addition, the nested constraints in rank assignment, edge crossing, and coordinate assignment of hierarchical layout method were also analyzed in this paper. Then, existing hierarchical layout algorithm was extended to cope with nested graphs according to nested criteria. Experiment results show that the drawings of the reversed class diagrams are more readable and understandable with proper hierarchies, nested relations, less crossings and optimal drawing area.