Open lunik1 opened 3 years ago
I am having trouble understanding how to use the ancestry cache, and the docs are not very clear. I assume it must be populated using ancestry-add however doing this the obvious way results in an error:
ancestry-add
(ancestry-add (ancestry-new) :child1 :parent1 :parent2)
Execution error (IllegalArgumentException) at loom.alg-generic/ancestry-add (alg_generic.cljc:558). Key must be integer
ancestry-add only seems to work if the parent nodes already exist in the cache, but then the cache does not properly reflect the hierarchy:
(ancestor? (ancestry-add (ancestry-add (ancestry-add (ancestry-new) :child) :parent) :child :parent) :child :parent)
false
I am having trouble understanding how to use the ancestry cache, and the docs are not very clear. I assume it must be populated using
ancestry-add
however doing this the obvious way results in an error:ancestry-add
only seems to work if the parent nodes already exist in the cache, but then the cache does not properly reflect the hierarchy: