You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
min-cut returns different results each time, only sometimes finding the correct result of 3.
This seems to be caused from the mutation side-effect of sort, in graph.lisp:
(loop :while rest :do
;; grow A by adding the node most tightly connected to A
(let ((new (car (sort rest #'> :key {connection-weight a}))))
(setf rest (remove new rest))
(push new a)))
changing it to (sort (copy-tree rest) ... and it returns the correct result every time.
The text was updated successfully, but these errors were encountered:
I was doing advent of code, day 25: https://adventofcode.com/2023/day/25
the test data is:
min-cut
returns different results each time, only sometimes finding the correct result of 3.This seems to be caused from the mutation side-effect of sort, in graph.lisp:
changing it to
(sort (copy-tree rest) ...
and it returns the correct result every time.The text was updated successfully, but these errors were encountered: