Skip to content

Small question about 2022 Day 16 walkthrough #16

Closed Answered by mebeim
hrushikeshrv asked this question in Q&A
Discussion options

You must be logged in to vote

@hrushikeshrv thanks for the kind words :)

wouldn't the graph given in the problem be a directed graph?

Well, technically yes, but if you notice in the input:

Valve AA has flow rate=0; tunnels lead to valves DD, II, BB
Valve BB has flow rate=13; tunnels lead to valves CC, AA
Valve CC has flow rate=2; tunnels lead to valves DD, BB
Valve DD has flow rate=20; tunnels lead to valves CC, AA, EE
...

For every arc X -> Y we also have Y -> X, i.e., above AA goes to DD, and if we look at DD we see it goes to AA. Yeah, they are technically two different directed arcs, but that's the same as having a single undirected arc.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@hrushikeshrv
Comment options

Answer selected by mebeim
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
question Further information is requested
2 participants