Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I would say that it gets a bit more complex than that.

some recipes can produce multiple related dishes, and some ingredients can have multi-step substitutions. So Graph would be a better representation.

you could join multiple dishes into final 'abstract' dish to force it into tree-esque shape with some shuffling hopefully, but i think that's unnecessary limitation - especially if you consider that some recipes give you some compound ingredients(stocks for example) as side-output that you might want to use in future!

This is a great case for using that information for planning future dishes you could cook for free.



100%

under the hood I have it more like a graph with levels. The traversal is from all of the "leaves" to a single node rather than from the head node towards the leaves as in a traditional tree. The upside-down tree is more for a visual for the reader.

At the moment I don't have a recipe that outputs 2 end states but entirely possible since it's more of a graph under the hood.




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

Search: