I'm drawing a graph of nodes connected by orthogonal edges with corners. The nodes are laid out on a grid, and the edges (conceptually) follow the grid lines. The paths the edges take are laid out with an A* pathfinder, and I'd like to keep those paths. However, obviously some edges will overlap -- that is, cover the same lines on the grid. A naive approach to laying out the edges just has them on top of one another (as in the left-hand diagram below). I would like to take a "metro map" approach (similar to the London Underground map, etc) where edges are slightly offset from the grid lines exactly in order that edges do not overlap. Is there an existing algorithm for laying out such edges?
