Skip to content

Commit 5041855

Browse files
committed
Add transit node routing comment
1 parent 1642769 commit 5041855

File tree

3 files changed

+3
-0
lines changed

3 files changed

+3
-0
lines changed

src/main/scala/eu/sim642/adventofcode2019/Day18.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ object Day18 {
2323
trait KeyNeighborsSolution extends Solution {
2424
case class PathData(distance: Int, pathDoors: Set[Pos], pathKeys: Set[Pos])
2525

26+
// https://en.wikipedia.org/wiki/Transit_node_routing
2627
def getKeyNeighbors(input: Input): collection.Map[Pos, collection.Map[Pos, PathData]]
2728

2829
override def collectKeysSteps(input: Input): Int = {

src/main/scala/eu/sim642/adventofcode2021/Day23.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ object Day23 {
3333

3434
private case class PathData(length: Int, pathPoss: Set[Pos])
3535

36+
// https://en.wikipedia.org/wiki/Transit_node_routing
3637
private val posNeighbors: collection.Map[Pos, collection.Map[Pos, PathData]] = {
3738
val allPoss: Set[Pos] = hallways ++ room2amphipod.keySet
3839

src/main/scala/eu/sim642/adventofcode2022/Day16.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ object Day16 {
1212

1313
case class ValveData(flowRate: Int, tunnels: Seq[Valve])
1414

15+
// https://en.wikipedia.org/wiki/Transit_node_routing
1516
def valveDists(valves: Map[Valve, ValveData]): collection.Map[Valve, collection.Map[Valve, Int]] = {
1617
val dists: mutable.Map[Valve, mutable.Map[Valve, Int]] = valves.view.mapValues(_.tunnels.map(_ -> 1).to(mutable.Map)).to(mutable.Map)
1718
// Floyd-Warshall

0 commit comments

Comments
 (0)