From 25671ff20107dc7e0895ad1a3d5980707710ccb1 Mon Sep 17 00:00:00 2001 From: Sergiu Ivanov Date: Sun, 31 Oct 2021 22:02:00 +0100 Subject: [PATCH] Add max-st-kruskal. --- graph.rkt | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/graph.rkt b/graph.rkt index ebb681b..95cde36 100644 --- a/graph.rkt +++ b/graph.rkt @@ -37,7 +37,7 @@ dfs dfs/generalized dag? tsort cc cc/bfs scc - min-st-kruskal + min-st-kruskal max-st-kruskal graphviz) @@ -187,6 +187,8 @@ ;; 5 Spanning Trees (define (min-st-kruskal g) (g:min-st-kruskal (gg g))) + (define (max-st-kruskal g) + (g:max-st-kruskal (gg g))) ;; 10 Graphviz (define (graphviz g #:output [output #f] #:colors [colors #f]) @@ -275,6 +277,7 @@ ;; 5 Spanning Trees [min-st-kruskal (-> Graph (Listof (List Any Any)))] + [max-st-kruskal (-> Graph (Listof (List Any Any)))] ;; 10 Graphviz [graphviz (->* (Graph) @@ -391,7 +394,9 @@ (define g0 (weighted-graph/undirected '((1 a b) (2 b c) (3 c a) (4 c d) (5 e a)))) (check-equal? (min-st-kruskal g0) - '((a e) (c d) (c b) (a b)))) + '((a e) (c d) (c b) (a b))) + (check-equal? (max-st-kruskal g0) + '((c b) (c a) (c d) (a e)))) (test-case "10 Graphviz" (define g (directed-graph '((a b) (b c))))