delorie.com/archives/browse.cgi | search |
Hi all, another friend of mine with background in physics proposed an interesting solution based on springs. Take our connection graph (with all the extra nodes for junctions) and replace line segments with springs. Take all pins of net1 and place them at -1;0 and take all pins of net2 and place them in +1;0 and place all the junctions in 0;0. Add sufficient friction to avoid oscillation then release the system and run the simulation until sum of spring energy changes less than Epsilon between two iterations. Draw a verticla line at 0;0 - what sprins it cuts are the edges we are looking for. This approach is too complicated for me to verify with examples without implementing a prototype, but I can imagine something like this could work. IIRC grpahviz's dot rendering does something similar to optimize placing of edges and minimize overall size. Regards, Tibor
webmaster | delorie software privacy |
Copyright © 2019 by DJ Delorie | Updated Jul 2019 |