An Algorithm for Automatic Layout of Entity-Relationship Diagrams