I am analyzing a large amount of Layers 0-4 Network Data. I am trying to render diagrams dynamically showing the Network Devices involved in the data (Desktop, Switch, Router, Server, etc.) and how they speak to each other (lines connecting them indicating a data flow). I have a pretty good heuristics from that data on where to place the devices in the diagrams (ARP, Gateways, etc.). My main issue is getting the lines that connect them to stop looking like spaghetti. PCB CAD programs seem to have and solve this issue, but also have to deal with other issues (length/impedance matching, N-layers, etc.).

I was wondering if there was an algorithm that just did the initial part of PCB Trace layout, specifically:


  • a 2D space
  • the graphical location of nodes
  • requests to connect some of the nodes together with lines

Generate line paths that

  • limit the number of crossovers
  • Minimize the length of a crossover when they occur
  • (not critical) Allow for 90 degree turns to be replaced with two 45 turns (the PCB trace look)
  • 1
    $\begingroup$ I wonder whether this question is really related to computer graphics. Wouldn't it be better to ask this question here? $\endgroup$ Aug 21 at 16:35
  • $\begingroup$ @Enigmatisms ,from experience, the EE guys use CAD but they don't program it. I thought about the Comp Sci stack exchange but they don't touch graphical subjects often. $\endgroup$
    – Liam Kelly
    Aug 21 at 17:06
  • 3
    $\begingroup$ I think the kind of problem you're thinking of would be more generally called graph layout, or graph drawing and you'll likely find more information if you explore from there than if you pursue PCB layout specifically (which is largely proprietary software). (I'm not sure whether this should be an answer, but I'm going with a comment because I'm not pointing at a specific “how to” for your problem.) $\endgroup$
    – Kevin Reid
    Aug 21 at 19:14


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Browse other questions tagged or ask your own question.