climech / grit

Multitree-based personal task manager
MIT License
1.67k stars 48 forks source link

diamonds are not allowed #12

Open muralikodali opened 3 years ago

muralikodali commented 3 years ago

when i tried to link two tasks , following error occurred :

Couldn't create link (5) -> (3): diamonds are not allowed

my terminal is alacritty ans OS is Arch Linux

terev commented 3 years ago

This seems like a slightly silly limitation considering diamonds are valid in a DAG. Maybe it's a current limitation because of the way the graph is drawn horizontally?

climech commented 3 years ago

Grit uses multitrees, which are diamond-free by definition. The constraint ensures that the set of all nodes reachable from any node induces a valid tree. Multitrees share some nice properties with regular DAGs (the potential for adding alternate contexts, reusing hierarchies), but unlike DAGs—which can quickly become very complex and hard to read—multitrees can be more easily 'digested' by viewing their induced tree substructures one at a time.

So cross links are fine, but given a tree

[ ] one (1)
 ├──[ ] two (2)
 │   └──[ ] three (3)
 └──[ ] four (4)

creating a link from 1 to 3, or from 4 to 2, is an invalid multitree operation and will result in the "diamonds are not allowed" error.

More on multitrees: http://adrenaline.ucsd.edu/kirsh/Articles/In_Process/MultiTrees.pdf

terev commented 3 years ago

Ok I think I understand. So multitrees are not really meant for representing dependencies? My thinking is because theres often a scenario where two tasks with the same parent may depend on the same child, but this would be invalid since it creates a diamond