From 1a9320f9e0993866c18e254f318d2749a3ff286c Mon Sep 17 00:00:00 2001 From: Sergiu Ivanov Date: Tue, 4 Jan 2022 00:27:38 +0100 Subject: [PATCH] manual: Add Coloring. --- manual.scrbl | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/manual.scrbl b/manual.scrbl index 30508a9..45743b8 100644 --- a/manual.scrbl +++ b/manual.scrbl @@ -3,7 +3,7 @@ @(require (for-label (only-in typed/racket require/typed require/typed/provide Any Boolean Void Sequenceof Listof List U False Number Values - Mutable-HashTable Immutable-HashTable)) + Natural HashTable Mutable-HashTable Immutable-HashTable)) (for-label (only-in math/matrix Matrix)) (for-label (only-in graph (matrix-graph? g:matrix-graph?))) (for-label (only-in data/gen-queue/fifo mk-empty-fifo)) @@ -185,6 +185,18 @@ Graph properties are not supported. @defproc[(transitive-closure [g Graph]) (Mutable-HashTable (List Any Any) Boolean)]{} @defproc[(johnson [g Graph]) (Mutable-HashTable (List Any Any) Number)]{} +@subsection{Coloring} +@defproc[(coloring [g Graph] + [num-colors Natural] + [#:order order (-> (Listof Any) (Listof Any)) (λ (x) x)]) + (U (Mutable-HashTable Any Number) False)]{} +@defproc[(coloring/greedy [g Graph] + [#:order order (U (-> (Listof Any) (Listof Any)) 'smallest-last) 'smallest-last]) + (Values Number (Mutable-HashTable Any Number))]{} +@defproc[(coloring/brelaz [g Graph]) (Mutable-HashTable Any Number)]{} +@defproc[(order-smallest-last [g Graph]) (Listof Any)]{} +@defproc[(valid-coloring? [g Graph] [coloring (HashTable Any Number)]) Boolean]{} + @section{License} Like the generic graph library, this library is licensed under the Apache