Skip to content

Conversation

@joodie
Copy link
Member

@joodie joodie commented Dec 15, 2020

No description provided.


When ~graph~ is ~"tree"~, the generated graph is a directed
acyclic graph with a single root note that has a nil reference -
in this case: ~{"person/father: ["person/name" nil]}~
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a bit confusing. This section is called "graphs and trees" but this paragraph indicates we're generating treelike graphs. Either change the title or describe what happens when the options "graph: tree" is omitted.

When a ~nilabe~ option is provided, this indicates the chance
(between 0 and 1) that any generated ref is a nil reference - a
new root. Combined with the ~graph: "tree"~ option above this
implies a forest of independent trees.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So what happens when "nilable" is omitted? Does it generate an infinite forest? Please describe.


Options is a map of keywords to values

* `:graph :tree`
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use - instead of *, this isn't orgmode. ;-)

for the tree's root, and there is only a single path between any two
nodes in the graph.

* `:nilable CHANCE`
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Idem.

(is (= 4 (count (keep (comp second :cat/parent) (:cat world))))
"One root for a tree")
(is (false? (detect-cycle world :cat/parent)))))

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing test case for nilable.

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

Successfully merging this pull request may close these issues.

2 participants