Re: Graph coloring with Scheme

2016-06-20 Thread Jan Wedekind
Thanks for the positive feedback. Here is a slightly modified version using a curried definition. I am using the algorithm to color live intervals in order to do register allocation. (use-modules (srfi srfi-1) (srfi srfi-26) (ice-9 curried-definitions)) (define (dot graph colors)

Re: Graph coloring with Scheme

2016-06-20 Thread Andy Wingo
What a delight! Thank you for this elegant snippet :) Andy On Fri 14 Nov 2014 19:16, Jan Wedekind writes: > Hi, > Here is an implementation [1] of Chaitin's graph coloring algorithm > using GNU Guile and Graphviz. Any feedback and suggestions are > welcome. Let me know if you can make the impl

Re: Graph coloring with Scheme

2014-11-18 Thread Jan Wedekind
Forgot to use the ordering actually. It needs to be: (define (coloring graph nodes) (assign-colors graph (nodes graph) (order graph (nodes graph Or one can do the ordering directly within the "assign-colors" function: (define (assign-colors graph nodes colors) (if (null? nodes) '() (

Graph coloring with Scheme

2014-11-14 Thread Jan Wedekind
Hi, Here is an implementation [1] of Chaitin's graph coloring algorithm using GNU Guile and Graphviz. Any feedback and suggestions are welcome. Let me know if you can make the implementation more concise ;) Regards Jan (use-modules (srfi srfi-1) (srfi srfi-26)) (define (dot graph