nikolaydubina / go-graph-layout

🔮 Graph Layout Algorithms in Go
MIT License
88 stars 1 forks source link

recently came across (eclipse layout kernel) #3

Open ymolists opened 2 years ago

ymolists commented 2 years ago

Hi.

Thank you so much for doing this amazing work. The links alone saved me a ton of time and i am sucker for layouts in all forms and shapes :-)

In my search for graph layout algorithms, I recently came across https://www.eclipse.org/elk/ and felt i should share with you . I might be able to port it to go once i need it or on a side project . Do you think it is already covered or its an additional one ? I saw that elk mentions it is based on Sugiyama work.

Best Regards

nikolaydubina commented 2 years ago

oh, absolutely. ELK looks beautiful. Do they use Graphviz inside or implemented everything themselves? I like that they solved ports; level assignment; positioning in levels; coordinate (x-assignment) within layers. It would be very nice to port/re-implement this to Go.

Yeah, if it is layered graph layout, chances are it is related to Sugiyama.

From my experience dealing with these algorithms, it is lots of effort to make it work. So I would rather share credits with all co-authors!

The plan of attack I propose is to fork my repo. This is just so signatures more-or-less same and architecture. Then independently port some important algo, for example x-coordinate assignment in layer. Why this algorithm? I think last time I worked on this problem layer assignment and ordering worked okay but x assignment did not work, this is "Brandes-Köpf".

If you have tests available in code, or in paper, I would highly recommend integrating them early on into coding (TDD style). When I worked on treemap algorithms it helped a lot. I suspect here would help too.

You may also need something to "see" and get "feel" if algo works. I previously implemented small WebAssembly UI (but deleted it later) to render and play with parameters. I recommend output in SVG (some basic code is in /svg folder). If you want to pan-and-zoom code, recommend go-svg-panzoom (I ported some JS into Go) for this. Else recommend making Makefile with lots of commands to test out parameters. Note of caution tho, don't over complicate UI. My mistake last time I was working on this project UI slowly merged with "business" graph logic and was very-very hard to split it back to something normal and working. Recommend either simple UI or just Make file with lots of CLI invocations.

Later we can make GitHub Organization and merge all code together there of this repo and yous repo. (If you do like 90% of work, I am okay just merging this all into your repo, maybe I just get some "inspiration" references, hhh 🤝). Don't worry too much if code diverges, we can reconcile. I am also planning to bring this project to some degree of completeness (at least can render something nice like ELK on front page). But that would take some months.