fork download
  1. #lang racket
  2.  
  3. (require "util/p-list.rkt")
  4.  
  5. (putprop! 'Start '(a b) '#:subnodes)
  6. (putprop! 'a '(e c) '#:subnodes)
  7. (putprop! 'e '(g h) '#:subnodes)
  8. (putprop! 'b '(c f) '#:subnodes)
  9. (putprop! 'c '(i j) '#:subnodes)
  10. (putprop! 'f '(k l) '#:subnodes)
  11. (putprop! 'l '(b) '#:subnodes)
  12.  
  13. ;;; 展開関数
  14. (define (expand node)
  15. (keyword-get node '#:subnodes '()))
  16.  
  17. ;;; ネットワーク探索
  18. (define (network-depth node1 node2)
  19. (let loop ((stack (expand node1)) (visited '()))
  20. (if (null? stack)
  21. null
  22. (let ((head (car stack)) (tail (cdr stack)))
  23. (or (eq? head node2)
  24. (loop (if (memq head visited)
  25. tail
  26. (append (expand head) tail))
  27. (cons head visited)))))))
Runtime error #stdin #stdout #stderr 0.54s 68896KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
open-input-file: cannot open module file
  module path: /home/S8oZTc/util/p-list.rkt
  path: /home/S8oZTc/util/p-list.rkt
  system error: no such file or directory; rktio_err=3
  context...:
   maybe-raise-missing-module
   default-load-handler
   standard-module-name-resolver
   perform-require!78
   for-loop
   finish
   [repeats 1 more time]
   pass-1-and-2-loop
   module-begin-k
   expand-module16
   expand-capturing-lifts
   expand-single
   temp74_0
   compile16
   temp68_2
   loop