Hacker News new | past | comments | ask | show | jobs | submit login

This part of a node ui for modeling satisfactory (the game) factories. Mostly for fun and learning, honestly.

So like, I have code to find optimal production chains and solve the node graph, using ILP through pyomo or Z3.

Some of the optimal production chains are ... a lot of nodes, as are plenty of factories. Without really good layout, it becomes a mess. Existing modelers sort of suck and have no auto-layout.

I bridged Elk (and elk.js, actually) into python, but wanted a fallback since this was ... crazy enough already and who knows if it will work on anyone else's computer :)

So AI wrote me about 4000 lines of just about 100% correct python graph layout code. In batches, one algorithm at a time, that i then combined. I did have to tell it what I wanted piece by piece, so i had to learn a lot about it - i could not get it to do all the pieces at once iteslf. I suspect due to context length limitations, etc.

It comes very close to ELK when it comes to this type of layout (elk supports other layouts, edge routing, etc), and implements the same algorithms with the same advanced techniques.




Wow! I'm glad I asked, that sounds awesome. I hope you get a chance to do a writeup with some screenshots at the the end of it; that would make for a great read. Do you have any code public yet?

And TIL about elk! I've had kind of a half project, called `gstd`, which tries to create a standard library/API to make working with node graphs in code as easy as working with other abstract data types, like Arrays. One of the important bits is that it lets you console log a graph so you can see it. I've been using d3 force directed graphs for layouts, and have played around with some custom layout algorithms, but have yet to find a good solution. Elk might actually be just what I've been looking for there!

Thanks for taking the time to respond!




Consider applying for YC's Summer 2025 batch! Applications are open till May 13

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: