Skip to content

Day 16: Proboscidea Volcanium #18

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
simonw opened this issue Dec 16, 2022 · 3 comments
Open

Day 16: Proboscidea Volcanium #18

simonw opened this issue Dec 16, 2022 · 3 comments
Labels

Comments

@simonw
Copy link
Owner

simonw commented Dec 16, 2022

https://adventofcode.com/2022/day/16

@simonw simonw added the day label Dec 16, 2022
@simonw
Copy link
Owner Author

simonw commented Dec 16, 2022

Work out the steps to release the most pressure in 30 minutes. What is the most pressure you can release?

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
Valve EE has flow rate=3; tunnels lead to valves FF, DD
Valve FF has flow rate=0; tunnels lead to valves EE, GG
Valve GG has flow rate=0; tunnels lead to valves FF, HH
Valve HH has flow rate=22; tunnel leads to valve GG
Valve II has flow rate=0; tunnels lead to valves AA, JJ
Valve JJ has flow rate=21; tunnel leads to valve II

Each minute you can either move to another valve (down a tunnel) or open the valve you are at.

Flow rate is in pressure per minute, so if you open a flow rate 13 valve with 28 minutes left the total pressure you will get from it will be 28 * 13 = 364

The answer for the example is 1651.

@simonw
Copy link
Owner Author

simonw commented Dec 16, 2022

Can probably do this with a depth first search of the different paths I could take.

@simonw
Copy link
Owner Author

simonw commented Dec 16, 2022

Fed this to ChatGPT:

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
Valve EE has flow rate=3; tunnels lead to valves FF, DD
Valve FF has flow rate=0; tunnels lead to valves EE, GG
Valve GG has flow rate=0; tunnels lead to valves FF, HH
Valve HH has flow rate=22; tunnel leads to valve GG
Valve II has flow rate=0; tunnels lead to valves AA, JJ
Valve JJ has flow rate=21; tunnel leads to valve II

Generate GraphViz notations showing the graph of valves and tunnels between them

Got back:

digraph {
  AA [label="Valve AA\nFlow rate: 0"]
  BB [label="Valve BB\nFlow rate: 13"]
  CC [label="Valve CC\nFlow rate: 2"]
  DD [label="Valve DD\nFlow rate: 20"]
  EE [label="Valve EE\nFlow rate: 3"]
  FF [label="Valve FF\nFlow rate: 0"]
  GG [label="Valve GG\nFlow rate: 0"]
  HH [label="Valve HH\nFlow rate: 22"]
  II [label="Valve II\nFlow rate: 0"]
  JJ [label="Valve JJ\nFlow rate: 21"]
  
  AA -> DD [label="Tunnel"]
  AA -> II [label="Tunnel"]
  BB -> CC [label="Tunnel"]
  BB -> AA [label="Tunnel"]
  CC -> DD [label="Tunnel"]
  CC -> BB [label="Tunnel"]
  DD -> CC [label="Tunnel"]
  DD -> AA [label="Tunnel"]
  DD -> EE [label="Tunnel"]
  EE -> FF [label="Tunnel"]
  EE -> DD [label="Tunnel"]
  FF -> EE [label="Tunnel"]
  FF -> GG [label="Tunnel"]
  GG -> FF [label="Tunnel"]
  GG -> HH [label="Tunnel"]
  HH -> GG [label="Tunnel"]
  II -> AA [label="Tunnel"]
  II -> JJ [label="Tunnel"]
  JJ -> II [label="Tunnel"]
}

Pasted that in here https://dreampuf.github.io/GraphvizOnline/#digraph%20%7B%0A%20%20AA%20%5Blabel%3D%22Valve%20AA%5CnFlow%20rate%3A%200%22%5D%0A%20%20BB%20%5Blabel%3D%22Valve%20BB%5CnFlow%20rate%3A%2013%22%5D%0A%20%20CC%20%5Blabel%3D%22Valve%20CC%5CnFlow%20rate%3A%202%22%5D%0A%20%20DD%20%5Blabel%3D%22Valve%20DD%5CnFlow%20rate%3A%2020%22%5D%0A%20%20EE%20%5Blabel%3D%22Valve%20EE%5CnFlow%20rate%3A%203%22%5D%0A%20%20FF%20%5Blabel%3D%22Valve%20FF%5CnFlow%20rate%3A%200%22%5D%0A%20%20GG%20%5Blabel%3D%22Valve%20GG%5CnFlow%20rate%3A%200%22%5D%0A%20%20HH%20%5Blabel%3D%22Valve%20HH%5CnFlow%20rate%3A%2022%22%5D%0A%20%20II%20%5Blabel%3D%22Valve%20II%5CnFlow%20rate%3A%200%22%5D%0A%20%20JJ%20%5Blabel%3D%22Valve%20JJ%5CnFlow%20rate%3A%2021%22%5D%0A%20%20%0A%20%20AA%20-%3E%20DD%20%5Blabel%3D%22Tunnel%22%5D%0A%20%20AA%20-%3E%20II%20%5Blabel%3D%22Tunnel%22%5D%0A%20%20BB%20-%3E%20CC%20%5Blabel%3D%22Tunnel%22%5D%0A%20%20BB%20-%3E%20AA%20%5Blabel%3D%22Tunnel%22%5D%0A%20%20CC%20-%3E%20DD%20%5Blabel%3D%22Tunnel%22%5D%0A%20%20CC%20-%3E%20BB%20%5Blabel%3D%22Tunnel%22%5D%0A%20%20DD%20-%3E%20CC%20%5Blabel%3D%22Tunnel%22%5D%0A%20%20DD%20-%3E%20AA%20%5Blabel%3D%22Tunnel%22%5D%0A%20%20DD%20-%3E%20EE%20%5Blabel%3D%22Tunnel%22%5D%0A%20%20EE%20-%3E%20FF%20%5Blabel%3D%22Tunnel%22%5D%0A%20%20EE%20-%3E%20DD%20%5Blabel%3D%22Tunnel%22%5D%0A%20%20FF%20-%3E%20EE%20%5Blabel%3D%22Tunnel%22%5D%0A%20%20FF%20-%3E%20GG%20%5Blabel%3D%22Tunnel%22%5D%0A%20%20GG%20-%3E%20FF%20%5Blabel%3D%22Tunnel%22%5D%0A%20%20GG%20-%3E%20HH%20%5Blabel%3D%22Tunnel%22%5D%0A%20%20HH%20-%3E%20GG%20%5Blabel%3D%22Tunnel%22%5D%0A%20%20II%20-%3E%20AA%20%5Blabel%3D%22Tunnel%22%5D%0A%20%20II%20-%3E%20JJ%20%5Blabel%3D%22Tunnel%22%5D%0A%20%20JJ%20-%3E%20II%20%5Blabel%3D%22Tunnel%22%5D%0A%7D%0A and got:

graphviz

simonw added a commit that referenced this issue Dec 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant