All pastes #754349 Raw Edit

Untitled

public text v1 · immutable
#754349 ·published 2007-10-29 22:57 UTC
rendered paste body
;;; ERROR MESSAGE

There is no applicable method for the generic function
  #<STANDARD-GENERIC-FUNCTION ADD-EDGE-BETWEEN-VERTEXES (2)>
when called with arguments
  ((#1=#<WEIGHTED-EDGE <#2=# #3=# NIL>> #1# #<WEIGHTED-EDGE <# #3# NIL>>
    . #<GRAPH-CONTAINER [0,0] {C2EC079}>)
   #2# #3#).
   [Condition of type SIMPLE-ERROR]

Restarts:
  0: [ABORT-REQUEST] Abort handling SLIME request.
  1: [TERMINATE-THREAD] Terminate this thread (#<THREAD "repl-thread" {B2B9779}>)

;;; CODE

(defun minimum-spanning-forest (graph)
  (iterate-edges  graph
		 #'(lambda (x)
		     (push x my-p-queue)))
  (sort my-p-queue #'(lambda (x y)
		       (cond ((<= 
			       (if (stringp (weight x))
				   (parse-integer (weight x))
				   (weight x))
			       (if (stringp (weight y))
				   (parse-integer (weight y))
				   (weight y)))
			      nil)
			     (t t))))
  (while (not (eq my-p-queue nil))
    (setq e (pop my-p-queue))
    (add-edge-between-vertexes F (vertex-1 e) (vertex-2 e))
    (if (any-undirected-cycle-p F)
	;(progn 
	 ; (delete-edge F e)
	  (incf cnt))))
  (print-container F)
  cnt)