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

> Our team tried a few options and is now implementing something from scratch instead. > > We also want text to be legible, dates and task names directly shown near the task bars, etc.

This is bin-packing with extra steps, which is famously NP-hard.




I think it's closer to graph colouring. And not the general version either. Apparently for such an interval graph linear time algorithms exist. [1]

[1]: https://en.m.wikipedia.org/wiki/Interval_graph


The Wikipedia page just shows a linear time algorithm for identification of an undirected graph as an interval graph. The article notes that there's a polynomial time algorithm for coloring, which is the task-line assignment analogous problem. Still, not NP-hard, but not linear either unless there's another resource that mentions otherwise.


The first paragraph mentions a linear time graph colouring algorithm. In fact further on they explain that a simple greedy algorithm that goes through the tasks in order of starting time will work. It's fairly easy to prove it does.

Maybe finding the optimal planning given some dependency is harder (though it isn't if you only have some simple requirements), but this is about visualising a Gantt chart, not calculating one.




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

Search: