Automatic graph drawing function for biopathways is indispensable for biopathway databases and softwares. This paper proposes a new grid-based algorithm for biopathway layout that considers (a) edge-edge crossing, (b) node-edge crossing, (c) distance measures between nodes, as its costs, and (d) subcellular localization information from Gene Ontology, as its constraints. For this algorithm, we newly define cost functions, devise an efficient method for computing the costs (a)-(c) by employing a matrix representing the difference between two layouts, and take a steepest descent method for searching locally optimal solutions and multi-step layout method for finding better solutions. We implemented this algorithm on Cell Illustrator which is a biopathway modeling and simulation software. The algorithm is applied to a signal transduction pathway of apoptosis induced by fas ligand. We compare our layout with that of the grid-based algorithm by Li and Kurata (Bioinformatics 21 (9):2036-2042, 2005). The result shows that our algorithm reduces edge-edge crossings and node-edge crossings, and solves the ''isolated island problem'', that is, despite the intension, some groups of nodes are apart from other nodes in the layout. As a result, the biological understandability of the layout is fairly improved.