diff --git a/day25/graph.go b/day25/graph.go index fb9c94b..a6546eb 100644 --- a/day25/graph.go +++ b/day25/graph.go @@ -137,30 +137,6 @@ func (g *Graph) dfcCycle(fromName, atName string, visited mapset.Set[string]) (c return } -func (g *Graph) DoThreeRemovals() { - from, to, found := g.findCycle() - log.Printf("first result %s, %s, %t", from, to, found) - // graph_test.go:26: first result xhk, rhn, true - g.RemoveEdge("xhk", "rhn") - - from, to, found = g.findCycle() - log.Printf("second result %s, %s, %t", from, to, found) - // graph_test.go:32: second result qnr, nvd, true - g.RemoveEdge("qnr", "nvd") - - from, to, found = g.findCycle() - log.Printf("third result %s, %s, %t", from, to, found) - // graph_test.go:36: third result lhk, cmg, true - - g.RemoveEdge("lhk", "cmg") - from, to, found = g.findCycle() - log.Printf("fourth result %s, %s, %t", from, to, found) - - // OK, so there could be more than 3 cycles. - // but if i want to break things into 2 components, i need to do more investigating - return -} - func (g *Graph) ComponentFrom(fromName string) (component mapset.Set[string]) { startNode := g.Nodes[fromName] component = mapset.NewSet[string](startNode.Name) diff --git a/day25/graph_test.go b/day25/graph_test.go index d76384a..886eb81 100644 --- a/day25/graph_test.go +++ b/day25/graph_test.go @@ -19,12 +19,6 @@ func TestRemoveEdge(t *testing.T) { t.Logf("after removing bvb-hfv %+v", g) } -func TestRunFindCycle(t *testing.T) { - filename := "example" - g := ReadGraphFile(filename) - g.DoThreeRemovals() -} - func TestCreateExampleMermaid(t *testing.T) { filename := "example" g := ReadGraphFile(filename)