This commit is contained in:
Yanick 2022-12-18 18:42:55 -05:00
parent df0d7b92a3
commit bc6b5259c1

View File

@ -1,6 +1,11 @@
import * as R from "remeda";
import u from "updeep";
import Graph from 'graphology';
import {bidirectional} from 'graphology-shortest-path';
import { combinations } from "combinatorial-generators";
import { readFile } from "../05/part1.js";
const parseLine = (line) => {
@ -62,5 +67,12 @@ function bestMoveFor(tunnels,minutesLeft,opened,location='AA',totalSteam=0,activ
export default (tunnels) => {
return bestMoveFor(tunnels,30,[]);
const graph = new Graph();
Object.entries(tunnels).forEach( ([location, { exits }]) => {
exits.forEach( exit => graph.addEdge(location, exit) );
});
console.log(graph);
};