[cl-graph-devel] Bayesian networks

Joel Reymont joelr1 at gmail.com
Tue Feb 7 19:16:25 UTC 2006


Hi Gary!

Thank you very much for the detailed explanation!

On Feb 7, 2006, at 7:01 PM, Gary King wrote:

> All edges have an element slot and you can use a weighted-edge to  
> get a weight slot. If you want a weighted-directed-edge, you'll  
> need to make a new class (which is a bit weird, sigh).

Yep, that's what I need.

> Something like this should work:
>
> (defun weighted-sum-of-connected-vertexes (vertex)
>   (let ((sum 0))
>     (iterate-target-edges
>      vertex
>      (lambda (e)
>        (incf sum (* (weight e) (element (other-vertex e vertex))))))
>     sum))

Is there a way to get the list of root vertices, though? Those  
vertices that have no edges coming into them and only edges coming out.

	Thanks, Joel

--
http://wagerlabs.com/








More information about the cl-graph-devel mailing list