mdegans / weave

Branching story writing tool with generative AI
Other
1 stars 0 forks source link

All-Pairs calculation for force directed layout #21

Open mdegans opened 2 months ago

mdegans commented 2 months ago

Currently some physics code (repulsion, attraction, collision) is limited by degree. This mostly works but with many nodes, despite it being fast, stuff can end up on top of each other.

If we do an all-pairs simulation, perhaps with Barnes-Hut optimization, this problem should go away. The impediment here is the data structure. Doing all pairs, from the options I can think about, would mean traversing the tree structure repeatedly (potentially slow) or flattening the data structure so one container owns all the nodes. Also Barnes-Hut would require a lot more code as well as changes to the data structure to be efficient (a quadtree or similar).