sort only for each edge, so related nodes will be closer to each other

svn: r14364

original commit: c880b1297c8279c42ca77541d6e908b4b00c3145
This commit is contained in:
Eli Barzilay 2009-03-30 21:10:16 +00:00
parent 719e7282ba
commit 07ae3cfac2

View File

@ -156,10 +156,10 @@
(let loop ([todo (list x)] [seen (list x)])
(if (null? todo)
'()
(let* ([next (append-map (lambda (x) (map edge-callee (node-callees x)))
(let* ([next (append-map (lambda (x)
(subsort (map edge-callee (node-callees x))))
todo)]
[next (remove-duplicates next)]
[next (subsort (remq* seen next))])
[next (remq* seen (remove-duplicates next))])
(append todo (loop next (append next seen)))))))
#|
(define (node id) (make-node id #f '() 0 0 '() '()))