Gadget & PiJohn
PiJohn PiJohn
Hey Gadget, I've been thinking about how to use graph theory to design the most efficient wiring path on a PCB so the signals don’t get all tangled. Ever tackled a puzzle where the edges represent wire lengths? Let’s brainstorm.
Gadget Gadget
Sure thing, let’s treat the PCB like a city map. Think of each pad as a node and each possible wire as an edge weighted by length. A shortest‑path algorithm, like Dijkstra, can find the minimal route between two components. If you’re connecting multiple points, that’s a traveling salesman problem—use a heuristic like nearest neighbor or a genetic algorithm to keep the total wire short while staying in the allowed layers. Remember to avoid crossing edges that aren’t allowed—plan a planar embedding first, then add vias only where needed. Need a quick sketch of the graph layout? Just give me the component list, and I’ll whip up a draft.
PiJohn PiJohn
Sounds good. Drop me the list of pads and the connections you need and I’ll sketch the graph for you. If you have any constraints on layers or trace widths, let me know, too—those details can change the optimal route. Just keep it simple and I’ll handle the math.
Gadget Gadget
Here’s a quick set to start: Pads: A, B, C, D, E, F Connections: A‑B, B‑C, C‑D, D‑E, E‑F, F‑A (a loop) and A‑D (cross‑bar) Layers: keep everything on layer 1, but allow a single via if you need to drop from 1 to 2 for the A‑D link. Trace width: 0.25 mm for signal traces, 0.5 mm for power. That should give you a solid base to crunch the shortest‑path math. Let me know if you want more nodes or extra constraints.
PiJohn PiJohn
Got it. Picture a hexagon with vertices A–F in order. The loop edges are the sides of the hexagon. The extra A‑D edge is a diagonal that would normally cross the center. Since we’re on a single layer, we can’t cross that diagonal with the loop edges. So we’ll route A‑D via a single via to layer 2 and back down, keeping the diagonal clear. A simple shortest‑path plan: - Route the loop on layer 1: A‑B‑C‑D‑E‑F‑A. - For A‑D, go A up to layer 2 (via), straight to D on layer 2, then back down to layer 1. That keeps all traces 0.25 mm wide, and if any power pads need thicker lines, bump them to 0.5 mm. If you want to tweak lengths or add more nodes, just let me know.
Gadget Gadget
Nice layout! That diagonal via will keep the loop clean and avoid crosstalk on layer 1. If you need to tweak the distance between A and D, just adjust the via pitch or add a short stub on layer 2—just make sure it stays under the 0.25 mm rule for signals. Let me know if any other nodes pop up or if you want to play with the trace spacing for better EMI performance.
PiJohn PiJohn
Sounds good—just keep the via close to A and D so the stub stays under 0.25 mm. If you add more pads or need tighter spacing for EMI, let me know and we can tweak the geometry.
Gadget Gadget
Got it—vias tucked right next to A and D, stub under 0.25 mm. I’ll keep an eye on any new pads or tighter spacing you need. Just drop the list and we’ll re‑route.
PiJohn PiJohn
All set—just send the updated list when you’re ready and we’ll tweak the routing.