Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

algorithm for depending Elements

Name: Someawe 2006-11-06 14:27

I just plainly hate algorithm that should be perfect, but the perfect solutions I come up with sre memory or runtime hungry like doom3 or even worse.
So this time it's about Elements that have dependencies like Linux Packages. So e.g 9 depends on 3 and 6, 3 depends on 6 and 1, etc. Now that I got those conditions I have to find out ALL possible orders in which I could install those Packages. I know that e.g. aptitude solves dependencies, but the packages where only an example.
So is there an perfect algorithm for this Problem and if not I'm sure this Problem has a name in theoretic  computer science.
Please /prog/ be my hero.

Name: Someawe 2006-11-10 8:48

>>8
WTF?! Didn't you notice that in my example there are multiple dependencies on same element as well as Dependencies shared by more than one Element.
How the fuck am I supposed to build a non-repeating tree with that easily? Even if I sort out the double Elements, still following the branches alone won't give me all orders.
I would value your advice if you would've said it a little nicer. If you want to insult me, at least think about what you say.

Well doesn't matter anymore, I've just written a method which just produces all combinations possible and then checks if they work with the dependencies. The time and memory usage is horrible but acceptable for the low amount of elements given.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List