Force directed graph using traceroute data as edge weights? #137

Open
opened 2026-10-04 23:02:04 +02:00 by adam · 4 comments
Owner

Rather than using geographic layout for nodes, I'd love a view that shows a force directed layout, using signal strength from traces.

Here's a prototype I was trying with just local traceroute data and https://networkx.org/en/:
Image

Rather than using geographic layout for nodes, I'd love a view that shows a force directed layout, using signal strength from traces. Here's a prototype I was trying with just local traceroute data and https://networkx.org/en/: <img width="2206" height="1304" alt="Image" src="https://github.com/user-attachments/assets/5ce56bb5-cb73-4683-8c80-dc79e6141f78" /> <!-- github-sync-id:3913078265 -->
Author
Owner

I don't think I understand force directed layout? Could you explain?

I don't think I understand force directed layout? Could you explain? <!-- github-comment-id:3870760151 -->
Author
Owner

If nodes are "closer" together in radio space (higher dB), they'd be plotted closer together, whereas nodes that are further apart would be pushed apart. This should correlate with physical/geographical layout, but may be different at times due to propagation/antennas/etc.

If nodes are "closer" together in radio space (higher dB), they'd be plotted closer together, whereas nodes that are further apart would be pushed apart. This should correlate with physical/geographical layout, but may be different at times due to propagation/antennas/etc. <!-- github-comment-id:3873367435 -->
Author
Owner

Cool idea. Are there any specific algorithms you would recommend?

Cool idea. Are there any specific algorithms you would recommend? <!-- github-comment-id:3876833675 -->
Author
Owner

Looking at your stack, mostly ruby, not sure. I don't have direct experience with a Ruby implementation of weighted networks like this.

The above example was https://networkx.org/en/ in Python.

Looks like there's a rubygem wrapper around GraphViz which I've used before: https://rubygems.org/gems/ruby-graphviz/versions/1.2.5

GraphViz can make diagrams like these:

Weight or length would be set to the dBi:

On the JS side, d3 might be closest, or but not sure if you want a JS dependency.

Looking at your stack, mostly ruby, not sure. I don't have direct experience with a Ruby implementation of weighted networks like this. The above example was https://networkx.org/en/ in Python. Looks like there's a rubygem wrapper around GraphViz which I've used before: https://rubygems.org/gems/ruby-graphviz/versions/1.2.5 GraphViz can make diagrams like these: - https://graphviz.org/Gallery/twopi/twopi2.html - https://graphviz.org/Gallery/neato/softmaint.html Weight or length would be set to the dBi: - https://graphviz.org/docs/attrs/weight/ - https://graphviz.org/docs/attrs/len/ On the JS side, [d3 might be closest](https://observablehq.com/@d3/disjoint-force-directed-graph/2), or but not sure if you want a JS dependency. <!-- github-comment-id:3880391919 -->
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: adam/potato-mesh#137