Small question about 2022 Day 16 walkthrough #16
-
|
First off, thank you so much for the walkthroughs that you publish! The walkthrough for 2022 day 16 really helped me learn a new way of approaching such a problem. I just had a small technical question. Here you say
My question was that wouldn't the graph given in the problem be a directed graph? Since once we follow a tunnel leading to a new valve, we can't go back to the previous valve and choose a different tunnel? I feel like that might change the solution a little bit. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
|
@hrushikeshrv thanks for the kind words :)
Well, technically yes, but if you notice in the input: For every arc |
Beta Was this translation helpful? Give feedback.
@hrushikeshrv thanks for the kind words :)
Well, technically yes, but if you notice in the input:
For every arc
X -> Ywe also haveY -> X, i.e., aboveAAgoes toDD, and if we look atDDwe see it goes toAA. Yeah, they are technically two different directed arcs, but that's the same as having a single undirected arc.