Timeline for Traversing an infinite graph using Dijkstra's algorithm to maximize cookie production speed
Current License: CC BY-SA 4.0
22 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Aug 19, 2021 at 18:21 | comment | added | Brian Vandenberg | Part 2 of the problem: 10 seconds in you're about to purchase your first Foo; you look over and realize your opponent is calmly continuing to bake and isn't purchasing a Foo. You call time-out to read the contract and realize they changed the wording: last one to 1,000 wins. Additionally, while reading the contract you realize the contract doesn't forbid purchasing an upgrade when you have zero machines. | |
S Feb 19, 2019 at 7:57 | history | bounty ended | Poyo | ||
S Feb 19, 2019 at 7:57 | history | notice removed | Poyo | ||
Feb 18, 2019 at 22:09 | answer | added | fabigler | timeline score: 2 | |
Feb 18, 2019 at 21:11 | vote | accept | Poyo | ||
Feb 18, 2019 at 21:10 | vote | accept | Poyo | ||
Feb 18, 2019 at 21:10 | |||||
Feb 13, 2019 at 9:46 | answer | added | Peter Taylor | timeline score: 4 | |
Feb 13, 2019 at 8:45 | comment | added | t3chb0t | @PeterTaylor ok, so it's just a game... | |
Feb 13, 2019 at 8:40 | comment | added | Peter Taylor | @t3chb0t, it is something real but OP has disguised it (or perhaps "anonymised it" would be more accurate) slightly. See their earlier question on math.SE where I think my answer motivated them to write this code. | |
Feb 13, 2019 at 8:27 | comment | added | t3chb0t | This is a programming-challange, isn't it? It isn't anything real... | |
Feb 13, 2019 at 5:10 | answer | added | xander | timeline score: 4 | |
S Feb 12, 2019 at 20:19 | history | bounty started | Poyo | ||
S Feb 12, 2019 at 20:19 | history | notice added | Poyo | Draw attention | |
Feb 9, 2019 at 21:00 | history | tweeted | twitter.com/StackCodeReview/status/1094340272857759744 | ||
Feb 9, 2019 at 7:19 | history | edited | Poyo | CC BY-SA 4.0 |
Ask question
|
Feb 7, 2019 at 6:48 | comment | added | Poyo | In this case, upgrades can only be bought once and apply retroactively to previously purchased items for simplicity, so your total production rate is (3 * 20) * 2. However, this digraph model aims to represent any number of different game configurations, wherein you may buy multiple upgrades, or they don't act retroactively, or so on. Your initial heuristic is correct, but only works in isolated cases and lacks the foresight to work in complex scenarios like the one that this question is a facsimile of. | |
Feb 7, 2019 at 6:38 | comment | added | vnp | Oh. Missed the upgrade part. Couple of side question: I bought two Foos, did an upgrade, then bought another Foo - what is its rate? also, may I upgrade them twice? | |
Feb 7, 2019 at 6:30 | comment | added | Poyo | In some scenarios, a seemingly suboptimal one-time purchase leads to an optimal path—for example, the Foo and Bar upgrades which double the total production rate of all Foos and Bars but can only be purchased when at least one Foo/Bar is already owned. | |
Feb 7, 2019 at 6:26 | comment | added | vnp | Right. Now we are getting somewhere. As soon as you can afford the machine, test the condition from my comment, and act accordingly. I honestly don't see any room for Dijkstra here. | |
Feb 7, 2019 at 6:12 | comment | added | Poyo | Ah, that's poor wording on my part—I mean that it's invariably better to buy your next item when you can afford it, rather than waiting any time, not that it's best to buy any item as soon as possible. | |
Feb 7, 2019 at 6:09 | comment | added | vnp | Because our target cookie count is cumulative, it is always better to buy something than not. I am not so sure. It really depends. If the target is \$t\$ cookies, your current production rate is \$v_0\$ cookie/sec, you have \$c_0\$ cookies, and you may use them to buy a machine to get a \$v_1\$ production rate, it only makes sense to buy if \$\frac{t}{v_1} < \frac{t-c}{v_0}\$. Am I getting something wrong? | |
Feb 7, 2019 at 5:48 | history | asked | Poyo | CC BY-SA 4.0 |