August 21, 2024

P86 - Node degree and graph coloration

a)Write a function (degree graph node) that determines the degree of a given node.

b) Write a function that generates a list of all nodes of a graph sorted according to decreasing degree.

c) Use Welch-Powell's algorithm to paint the nodes of a graph in such a way that adjacent nodes have different colors.

lisp

;;; Node degrees
;;; uses adjacency-list form

(load "p84.lisp")

(defun degree (graph node)
  (length (neighbors node graph))
  )
Be first to comment
Leave a reply