Ask HN: What is new in algorithms and data structures these days?
737 pointsAlgs/DS were my first love in CS. Nowadays, all we hear about is AI/ML. There must be hardware/software improvements coming from or necessitating fundamental Algs/DS research.
Care to share any of the favorite recent results?
Are there big fields still making gains behind all this computing surge?
Comments (211) 45 threads
Show all comments
Showing thread 23 of 45
For example, the constraints may be:
1) The graph is read left to right. This informs the layout such that those spiral and circular graph layout algorithms that blow out the graph do not work.
2) Try to keep certain types of nodes vertical aligned, so that they lie on the same horizontal line.
3) Minimize edge crosses.
4) Have the edges be not lines but paths made up of horizontal and vertical lines. This probably requires some path finding as well.
5) Be able to live update in the sense that a new node or edge entry into the graph does not drastically re-layout the graph for reasonable inserts.
Then it's relatively easy to formulate your (5) as an additional constraint in the same language:
Given a previous solution x_0, find a new solution x_1 to slightly different constraints f_1 by minimizing af_1(x_1) + bdistance(x_1-x0)
You'd need to decide on the weights a and b and on the distance function. (Instead combining distance from old solution and constraints linearly, you could also use other ways to combine them. Eg you could also say:
Keep f_1(x_1) <= epsilon and minimize distance(x_1-x_0). Or you could do minimize the sum of squares:
af_1(x_1)^2 + bdistance(x_1-x0)^2
Specifics depends on what works well for your problem, and what your solver can handle.
See https://developers.google.com/optimization for a free library of solvers.
And it may be the case that (5) is actually the most implrtant constraint. Haha.
We worked on this problem, too, and Gordon Woodhull created a working system for dynamic hierarchical layout. I think he also incorporated an improved node positioning and edge routing algorithm of Ulrik Brandes. The code is still available here, I think: https://www.dynagraph.org
It was great work. We meant well, but were overextended for the resources we had. Gordon is a brilliant programmer.
To meet all these criteria would indeed be amazing. For 5) you may get semi-reliable results by doing the layout deterministically and optimize for things like short edge length, so adding new nodes would just push around the rest a little bit. But good luck avoiding crossings at the same time.
[0] https://cs.brown.edu/people/rtamassi/papers/gd-tutorial/gd-c...