Initial arrangement that roughly minimizes the total length of links #3510
Unanswered
fabiospampinato
asked this question in
Q&A
Replies: 1 comment
-
According to what I've read finding the global minimum for this kind of problem is NP-hard (except for the case where everything is in the same spot I guess) 🤔 That probably doesn't matter much, just positioning nodes a bit smartly should go a long way. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
The initial phyllotaxis arrangement in d3-force looks great on its own, but when considering that for my use case a little physics simulation is going to get executed in order, essentially, to try to minimize the distance between linked nodes maybe a phyllotaxis arrangement isn't the best kind of initial arrangement that I should be doing, maybe nodes should be initially positioned in a way that tends to significantly shorten the length of links compared to a regular phyllotaxis arrangement that just doesn't considers links at all.
So the question is: is there some decent known algorithm or d3 extension for doing that? If not does anybody have any ideas about how I should be approaching the problem? It's not clear to me what kind of data structure I should make in order to position nodes smartly 🤔
Beta Was this translation helpful? Give feedback.
All reactions