Permalink
Browse files

tests

  • Loading branch information...
1 parent e9a15e2 commit ca16745bf323b5d23bd8d7b5bbf28cd87b77957a @holdenk committed Feb 11, 2013
Showing with 13 additions and 7 deletions.
  1. +1 −1 graph.scm
  2. +12 −6 test/graph-test.scm
View
@@ -249,7 +249,7 @@
))
(loop (+ k 1))
)))
- (list distances next)
+ (list distances next vertex-map)
)))
View
@@ -16,20 +16,26 @@
(test-end "minimum spanning tree")
(test-begin "flyod-warshall")
(test (vector 0 1 1 0)
- (floyd-warshall-algorithm
+ (car (floyd-warshall-algorithm
(digraph->graph
(alist->digraph
'((a d 1))))
- edge-label))
+ edge-label)))
(test (vector 0 1 +inf.0 0)
- (floyd-warshall-algorithm
+ (car (floyd-warshall-algorithm
(alist->digraph
'((a d 1)))
- edge-label))
+ edge-label)))
(test (vector 0 1 101 +inf.0 0 100 +inf.0 +inf.0 0)
- (floyd-warshall-algorithm
+ (car (floyd-warshall-algorithm
(alist->digraph
'((a d 1) (d c 100)))
- edge-label))
+ edge-label)))
+(test (vector -1 1 1 -1 -1 2 -1 -1 -1)
+ (cadr (floyd-warshall-algorithm
+ (alist->digraph
+ '((a d 1) (d c 100)))
+ edge-label)))
+
(test-end "flyod-warshall")
(test-exit)

0 comments on commit ca16745

Please sign in to comment.