Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect methods has-parent-p, has-children-p #6

Closed
martinez opened this issue Feb 11, 2016 · 0 comments
Closed

Incorrect methods has-parent-p, has-children-p #6

martinez opened this issue Feb 11, 2016 · 0 comments

Comments

@martinez
Copy link

There is a mistake in the implementation of has-children-p and has-parent-p, because they do the opposite of their specification.

Their implementations should be exchanged. Documentation should also be updated accordingly, because has-parent-p should look at target edges, and has-children-p look at source edges.

Example case:

(ql:quickload :cl-graph)
(use-package :cl-graph)
(setf g (make-graph 'graph-container :vertex-test #'equal :default-edge-type :directed))
(add-edge-between-vertexes g "foo" "bar")

(has-children-p (find-vertex g "foo"))
> NIL
(has-children-p (find-vertex g "bar"))
> T
(has-parent-p (find-vertex g "foo"))
> T
(has-parent-p (find-vertex g "bar"))
> NIL
``
@gwkkwg gwkkwg closed this as completed in ba6d7b9 Mar 4, 2016
gwkkwg pushed a commit that referenced this issue Mar 4, 2016
fix methods has-parent-p, has-children-p (fixes #6)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant